Open CASCADE学习|环形弹簧建模

本文介绍了环形弹簧的结构、特性及其在工程中的应用,以及如何用C++进行三维建模,展示了制造过程中的关键步骤和几何体构建。
摘要由CSDN通过智能技术生成

目录

Draw Test Harness:

C++:


环形弹簧,也称为弓簧,是由拉伸弹簧和连接弹簧构成的。在结构上,环形弹簧通常包括端环、外环和内环,其主要参数包括弹簧的内径、外径和自由高度。环形弹簧的一个显著特点是,当承受轴向压缩载荷时,各圆环会沿圆锥面相对滑动,导致整个弹簧产生轴向变形。

环形弹簧的一个主要特性是,与其他各种弹簧相比,它几乎只产生纯压缩和拉伸应力,因此其单位体积材料的变形能要较其他弹簧大得多。这使得环形弹簧特别适用于空间尺寸受限制,但需要吸收大量能量和强力缓冲的场合,例如铁道车辆的链接部分、受强大冲击的缓冲装置、大型管道的吊架和大容量电流遮断器的固定支承等。

在环形弹簧的制造过程中,会先使用专用胎夹具夹紧拉伸弹簧的一端并旋入连接弹簧,然后将拉伸弹簧的另一端旋转后套入连接弹簧的另一端,最后利用回转力将连接弹簧旋接在拉伸弹簧的内部,从而构成环形弹簧。

Draw Test Harness:

pload MODELING VISUALIZATION# use torus surface.torus aTorus 10 2set aSlope 0.05line aLine2d 0 0 $aSlope 1trim aSegment aLine2d 0 2*pi# make edge by the pcurve.mkedge aHelixEdge aSegment aTorus 0 2*pi/$aSlope# there is no curve 3d in the pcurve edge.# so need this to approximate one.mkedgecurve aHelixEdge 0.01wire aHelixWire aHelixEdge# make the profile.circle aProfile 12 0 0 1 1 1 0.3mkedge aProfile aProfilewire aProfile aProfilemkplane aProfile aProfile# display the profile.vdisplay aProfile aHelixEdge# loft the circle along the helix curve.pipe aSpring aHelixWire aProfile# display the result.vdisplay aSpring#vsetmaterial aSpring steelvsetgradientbg 180 200 255 180 180 180 2vsetdispmode 1vzbufftrihedronset ray tracingif { ! [catch {vrenderparams -raytrace -shadows -reflections -fsaa -rayDepth 5}] } {  vtextureenv on 1}

C++:

#include <Geom_ToroidalSurface.hxx>
#include <gp_Lin2d.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <GCE2d_MakeSegment.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepLib.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <Geom_Circle.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepOffsetAPI_MakePipe.hxx>
#include <TopoDS.hxx>
​
#include"Viewer.h"
​
int main(int argc, char* argv[])
{
    gp_Ax3 loc = gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0));
    Handle(Geom_ToroidalSurface) aTorus =new Geom_ToroidalSurface(loc, 10, 2);
    gp_Lin2d aLine2d(gp_Pnt2d(0.0, 0.0), gp_Dir2d(0.05, 1.0));
    Handle(Geom2d_TrimmedCurve) aSegment = GCE2d_MakeSegment(aLine2d, 0.0, M_PI * 2.0);
    TopoDS_Edge aHelixEdge = BRepBuilderAPI_MakeEdge(aSegment, aTorus, 0.0, 2.0 * M_PI/0.05);
    BRepLib::BuildCurves3d(aHelixEdge,0.01);
    BRepBuilderAPI_MakeWire aHelixWire;
    aHelixWire.Add(aHelixEdge);
    Handle(Geom_Circle) aProfile = new Geom_Circle(gp_Ax2(gp_Pnt(12, 0, 0), gp_Dir(1, 1, 1)), 0.3);
    TopoDS_Edge aProfilee = BRepBuilderAPI_MakeEdge(aProfile);
    BRepBuilderAPI_MakeWire aProfilew;
    aProfilew.Add(aProfilee);
    TopoDS_Shape aProfilef = BRepBuilderAPI_MakeFace(aProfilew);
    BRepOffsetAPI_MakePipe aSpring(TopoDS::Wire(aHelixWire), aProfilef, GeomFill_IsCorrectedFrenet, Standard_False);
    TopoDS_Shape Spring = aSpring.Shape();
    Viewer vout(50, 50, 500, 500);
    vout << aHelixWire;
    vout << aProfilef;
    vout << Spring;
    vout.StartMessageLoop();
    return 0;
​
}
​

  • 12
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值