public override void Run(RenderControl render) { var material = MeshStandardMaterial.Create("metal-double"); material.SetColor(new Vector3(1.0f, 0.8f, 0.0f)); material.SetMetalness(0.8f); material.SetRoughness(0.5f); material.SetFaceSide(EnumFaceSide.DoubleSide); var startPt = new GVec(0, 100, 0); var points = new GPntList(); points.Add(new GPnt(startPt.XYZ())); points.Add(new GPnt(startPt.Added(new GVec(0, 0, 150)).XYZ())); points.Add(new GPnt(startPt.Added(new GVec(0, 100, 150)).XYZ())); points.Add(new GPnt(startPt.Added(new GVec(-100, 100, 150)).XYZ())); points.Add(new GPnt(startPt.Added(new GVec(-100, 300, 150)).XYZ())); points.Add(new GPnt(startPt.Added(new GVec(100, 300, 150)).XYZ())); TopoShape path = SketchBuilder.MakePolygon(points, false); var sectionList = new TopoShapeList(); GAx2 coord1 = new GAx2(new GPnt(startPt.Added(new GVec(-25, -25, 0)).XYZ()), GP.DY()); TopoShape section1 = SketchBuilder.MakeRectangle(coord1, 50, 50, 10, false); render.ShowShape(section1, ColorTable.Red); render.ShowShape(path, ColorTable.Green); TopoShape pipe = FeatureTool.SweepByFrenet(section1, path, EnumSweepTransitionMode.RoundCorner, false); BufferShape bs = new BufferShape(pipe, material, null, 0.1f); bs.Build(); var node = new BrepSceneNode(bs); render.ShowSceneNode(node); }
public override void Run(RenderControl render) { var sketch = SketchBuilder.MakeEllipse(GP.Origin(), 5, 3, GP.DX(), GP.DZ()); // 1. Sweep { GPntList points = new GPntList { GP.Origin(), new GPnt(20, 10, 30), new GPnt(50, 50, 50), }; var path = SketchBuilder.MakeBSpline(points); render.ShowShape(path, Vector3.Green); var feature = FeatureTool.Sweep(sketch, path, EnumGeomFillTrihedron.ConstantNormal); render.ShowShape(feature, Vector3.Blue); } // 2. Revol { var feature = FeatureTool.Revol(sketch, new GAx1(new GPnt(-20, 0, 0), GP.DY()), 90); render.ShowShape(feature, Vector3.Green); } // 3. Loft { var baseWire = SketchBuilder.MakeRectangle(new GAx2(new GPnt(50, -50, 0), GP.DZ()), 20, 20, 5, false); var topWire = SketchBuilder.MakeCircle(new GPnt(60, -40, 40), 5, GP.DZ()); var loft = FeatureTool.Loft(baseWire, topWire, true); render.ShowShape(loft, Vector3.Red); } }
public override void Run(RenderControl render) { var startPt = new GVec(0, 100, 0); var points = new GPntList(); points.Add(new GPnt(startPt.XYZ())); points.Add(new GPnt(startPt.Added(new GVec(0, 0, 150)).XYZ())); points.Add(new GPnt(startPt.Added(new GVec(0, 100, 150)).XYZ())); points.Add(new GPnt(startPt.Added(new GVec(-100, 100, 150)).XYZ())); points.Add(new GPnt(startPt.Added(new GVec(-100, 300, 150)).XYZ())); points.Add(new GPnt(startPt.Added(new GVec(100, 300, 150)).XYZ())); TopoShape path = SketchBuilder.MakePolygon(points, false); var sectionList = new TopoShapeList(); GAx2 coord1 = new GAx2(new GPnt(startPt.Added(new GVec(-25, -25, 0)).XYZ()), GP.DY()); TopoShape section1 = SketchBuilder.MakeRectangle(coord1, 50, 50, 10, false); render.ShowShape(section1, Vector3.Red); render.ShowShape(path, Vector3.Green); TopoShape pipe = FeatureTool.SweepByFrenet(section1, path, EnumSweepTransitionMode.RoundCorner, false); render.ShowShape(pipe, Vector3.Blue); }