Compression spring

Use the following code to model a compression spring.

compression_spring.png

LinearPath lp = LinearPath.CreateHelix(10, 8, 4, false, 0.25);
            
Curve rail = Curve.CubicSplineInterpolation(lp.Vertices);

Plane normalToRail = new Plane(rail.StartPoint, rail.StartTangent);

viewportLayout1.Entities.Add(new PlanarEntity(normalToRail, 5), 0, Color.Magenta);

Circle section = new Circle(normalToRail, 2);

devDept.Eyeshot.Entities.Region sectionReg = new devDept.Eyeshot.Entities.Region(section);

Solid3D compressionSpring = sectionReg.SweepAsSolid3D(rail, .1, sweepMethodType.RoadlikeTop);

viewportLayout1.Entities.Add(compressionSpring, 0, Color.SlateGray);
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.