コード例 #1
0
        public void UpdateGeometry()
        {
            if (_VisibleNode == null)
            {
                _VisibleNode = new GroupSceneNode();
                FaceStyle fs = new FaceStyle();
                fs.SetColor(new ColorValue(0, 0, 1.0f, 0.5f));
                fs.SetTransparent(true);
                _VisibleNode.SetFaceStyle(fs);
            }

            _VisibleNode.ClearAll();

            Path.BuildGeometry();

            TopoShape start = GlobalInstance.BrepTools.Extrude(Path.Section, Tool.ZStart, Vector3.UNIT_Z);
            TopoShape end   = GlobalInstance.BrepTools.Extrude(Path.Section, Tool.ZEnd, Vector3.UNIT_Z);

            _VisibleNode.AddNode(GlobalInstance.TopoShapeConvert.ToEntityNode(start, 0.1f));
            _VisibleNode.AddNode(GlobalInstance.TopoShapeConvert.ToEntityNode(end, 0.1f));

            Matrix4 trf = GlobalInstance.MatrixBuilder.MakeTranslate(Tool.Position);

            _VisibleNode.SetTransform(trf);
        }
コード例 #2
0
        public override void UpdateGeometry()
        {
            VisualNode.ClearAll();

            Coordinate3 coord = new Coordinate3();

            coord.X = -Vector3.UNIT_Y;
            coord.Y = Vector3.UNIT_Z;
            coord.Z = Vector3.UNIT_X;

            Matrix4 trf = GlobalInstance.MatrixBuilder.ToWorldMatrix(coord);

            foreach (TopoShape edge in Section)
            {
                TopoShape shape = GlobalInstance.BrepTools.Extrude(edge, Length, -Vector3.UNIT_Z);
                shape = GlobalInstance.BrepTools.Transform(shape, trf);

                VisualNode.AddNode(GlobalInstance.TopoShapeConvert.ToSceneNode(shape, 0.01f));
            }
        }