🌶️ Compression spring

Use the following code to model a compression spring.

LinearPath lp = LinearPath.CreateHelix(10, 8, 4, false, 0.25);

Curve rail = Curve.CubicSplineInterpolation(lp.Vertices);

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

design1.Entities.Add(new PlanarEntity(normalToRail, 5), design1.Layers[0].Name, Color.Magenta);

devDept.Eyeshot.Entities.Region sectionReg = devDept.Eyeshot.Entities.Region.CreateCircle(normalToRail, 2);

Brep compressionSpring = sectionReg.SweepAsBrep(rail, .1, sweepMethodType.RoadlikeTop);

design1.Entities.Add(compressionSpring, design1.Layers[0].Name, Color.SlateGray);
Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.

Articles in this section

See more