Example #1
0
        private void sTLToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter = "STL (*.stl)|*.stl|IGES (*.igs;*.iges)|*.igs;*.iges|STEP (*.stp;*.step)|*.stp;*.step|BREP (*.brep)|*.brep|All Files(*.*)|*.*";

            if (DialogResult.OK != dlg.ShowDialog())
            {
                return;
            }


            TopoShape shape = GlobalInstance.BrepTools.LoadFile(new AnyCAD.Platform.Path(dlg.FileName));

            renderView.RenderTimer.Enabled = false;
            if (shape != null)
            {
                TopoShapeGroup group = new TopoShapeGroup();
                group.Add(shape);
                SceneManager sceneMgr = renderView.SceneManager;
                SceneNode    rootNode = GlobalInstance.TopoShapeConvert.ToSceneNode(shape, 0.1f);
                if (rootNode != null)
                {
                    sceneMgr.AddNode(rootNode);
                }
            }
            renderView.RenderTimer.Enabled = true;


            renderView.FitAll();
            renderView.RequestDraw(EnumRenderHint.RH_LoadScene);
        }
Example #2
0
        private void ImportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter = "STEP (*.stp;*.step)|*.stp;*.step|STL (*.stl)|*.stl|IGES (*.igs;*.iges)|*.igs;*.iges|BREP (*.brep)|*.brep|All Files(*.*)|*.*";

            if (DialogResult.OK != dlg.ShowDialog())
            {
                return;
            }

            TopoShape shape = GlobalInstance.BrepTools.LoadFile(new AnyCAD.Platform.Path(dlg.FileName));

            topoShape = shape;
            #region Render Shape
            renderView.RenderTimer.Enabled = false;
            if (shape != null)
            {
                renderView.ShowGeometry(shape, shapeId);
            }
            renderView.RenderTimer.Enabled = true;
            renderView.FitAll();
            renderView.RequestDraw(EnumRenderHint.RH_LoadScene);

            #endregion
        }
Example #3
0
 private void Panel3_SizeChanged(object sender, EventArgs e)
 {
     if (renderViewYZ != null)
     {
         renderViewYZ.Size = panel3.ClientSize;
         renderViewYZ.Renderer.SetStandardView(EnumStandardView.SV_Right);
         renderViewYZ.ExecuteCommand("Pan");
         renderViewYZ.RequestDraw();
     }
 }
Example #4
0
        private TopoShape DrawRect(List <Vector3> vertex)
        {
            var face = GlobalInstance.BrepTools.FillFace(vertex);

            renderViewDraw.ClearScene();
            SceneManager sceneMgr = renderViewDraw.SceneManager;
            SceneNode    rootNode = GlobalInstance.TopoShapeConvert.ToSceneNode(face, 0.1f);

            if (rootNode != null)
            {
                sceneMgr.AddNode(rootNode);
            }
            renderViewDraw.FitAll();
            renderViewDraw.RequestDraw(EnumRenderHint.RH_LoadScene);
            return(face);
        }
Example #5
0
 private void shadeWithEdgeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     renderView.ExecuteCommand("ShadeWithEdgeMode");
     renderView.RequestDraw();
 }