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 }
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); }
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); }
private void SectionBtn_Click(object sender, EventArgs e) { //SelectedShapeQuery context = new SelectedShapeQuery(); //renderView.QuerySelection(context); //var shape = context.GetGeometry(); TopoShape shapeXZ = new TopoShape(); TopoShape shapeYZ = new TopoShape(); if (topoShape != null) { shapeXZ = Section(topoShape, new Vector3(0, 1, 0)); shapeYZ = Section(topoShape, new Vector3(1, 0, 0)); } #region Render if (topoShape != null) { renderViewXZ.ClearScene(); renderViewXZ.ShowGeometry(shapeXZ, shapeId); renderViewYZ.ClearScene(); renderViewYZ.ShowGeometry(shapeYZ, shapeId); } renderViewXZ.FitAll(); renderViewYZ.FitAll(); renderViewXZ.RequestDraw(EnumRenderHint.RH_LoadScene); renderViewYZ.RequestDraw(EnumRenderHint.RH_LoadScene); #endregion }