public ModelView3d() { InitializeComponent(); //GlobalInstance.RegisterSDK("TEST", "TEST", "2427baa951f0ecc85a072a27ef1df119"); m_RenderView = new RenderWindow3d(); m_RenderView.Size = this.ClientSize; m_RenderView.Dock = System.Windows.Forms.DockStyle.Fill; this.Controls.Add(m_RenderView); }
public MainForm() { InitializeComponent(); // Add 3D RenderView to container. var container = this.splitContainer1.Panel2; m_RenderView = new RenderWindow3d(); m_RenderView.Size = container.ClientSize; m_RenderView.Dock = System.Windows.Forms.DockStyle.Fill; container.Controls.Add(m_RenderView); }
public bool Test(RenderWindow3d context) { OpenFileDialog dlg = new OpenFileDialog(); dlg.Filter = "STEP (*.stp;*.step)|*.stp;*.step"; if (dlg.ShowDialog() != DialogResult.OK) { return(false); } var shape = GlobalInstance.BrepTools.LoadFile(new Path(dlg.FileName)); if (shape == null) { return(false); } // 1. Adjust position and direction by box var box = shape.GetBBox(); var sz = box.Size(); var center = box.GetCenter(); Matrix4 trf = GlobalInstance.MatrixBuilder.MakeTranslate(-center); if (sz.X < sz.Y && sz.X < sz.Z) { trf = GlobalInstance.MatrixBuilder.MakeRotation(90, Vector3.UNIT_Y) * trf; } else if (sz.Y < sz.X && sz.Y < sz.Z) { trf = GlobalInstance.MatrixBuilder.MakeRotation(90, Vector3.UNIT_X) * trf; } shape = GlobalInstance.BrepTools.Transform(shape, trf); // 2. Find base face Solid solid = new Solid(shape); context.ShowGeometry(shape, 100); foreach (var fg in solid.SideFaceGroup) { foreach (var face in fg.Faces) { context.ShowGeometry(face.GetShape(), 100); } break; } return(true); }
public void Init(RenderWindow3d renderView) { // TODO: change parameters Bolt.UpdateShape(); Nut.UpdateShape(); Bolt.Node = renderView.ShowGeometry(Bolt.Shape, Bolt.Id); Bolt.Node.SetFaceStyle(RedStyle); Nut.Node = renderView.ShowGeometry(Nut.Shape, Nut.Id); FaceStyle faceStyle = new FaceStyle(); faceStyle.SetTransparecy(0.5f); faceStyle.SetTransparent(true); Nut.Node.SetFaceStyle(faceStyle); }
public FeatureContext(RenderWindow3d renderView) { RenderView = renderView; CurrentId = new ElementId(100); }