试用期员工
- UID
- 665
- 积分
- 258
- 金币
-
- 活跃
-
- 阅读权限
- 30
- 注册时间
- 2006-9-18
- 最后登录
- 1970-1-1
|
最近发现和个开源的ANYCAD工具,超级好用,可以用他来用他来显示GEN
1.利用NUGET,下载ANYCAD到到工程,会自动引用
-->
2.在窗体上放置一个SplitContainer控件
-->
3.把SplitContainer1.Panel当成挂上ANYCAD显示控件,代码如下
-->
4.写选择左边的LIST时的事件
- Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
- GroupBox2.Text = "GEN文件列表" + ListBox1.SelectedItems.Count.ToString + "/" + ListBox1.Items.Count.ToString
- If Me.ListBox1.SelectedItems.Count > 0 Then
- mRenderView.ClearAll()
- Dim material_mark As BasicMaterial
- material_mark = BasicMaterial.Create("gold")
- material_mark.SetColor(New AnyCAD.Foundation.Vector3(0, 1, 0))
- Dim material_burn As BasicMaterial
- material_burn = BasicMaterial.Create("ruby")
- material_burn.SetColor(New AnyCAD.Foundation.Vector3(1, 0, 0))
- Dim material_plate As BasicMaterial
- material_plate = BasicMaterial.Create("ruby")
- material_plate.SetColor(New AnyCAD.Foundation.Vector3(1, 1, 1))
- Dim str As String = Me.ListBox1.SelectedItems(0)
- Dim genFileName As String = (Me.ToolStripStatusLabel4.Text & str)
- Dim pocessor As New ToppingPocessor
- pocessor.GetSegList(genFileName)
- For i = 0 To pocessor.segList.Count - 1
- Dim segment As SegmentCls = pocessor.segList(i)
- If segment.radius = 0 Then
- Dim line_SB = SketchBuilder.MakeLine(New GPnt(segment.start_u, segment.start_v, 0), New GPnt(segment.end_u, segment.end_v, 0))
- If segment.action = "Mark" Then
- mRenderView.ShowSceneNode(BrepSceneNode.Create(line_SB, material_mark, material_mark))
- Else
- mRenderView.ShowSceneNode(BrepSceneNode.Create(line_SB, material_burn, material_burn))
- End If
- Else
- Dim arc_SB = SketchBuilder.MakeArcOfCircle(New GPnt(segment.start_u, segment.start_v, 0), New GPnt(segment.end_u, segment.end_v, 0), New GPnt(segment.amp_u, segment.amp_v, 0))
- If segment.action = "Mark" Then
- mRenderView.ShowSceneNode(BrepSceneNode.Create(arc_SB, material_mark, material_mark))
- Else
- mRenderView.ShowSceneNode(BrepSceneNode.Create(arc_SB, material_burn, material_burn))
- End If
- End If
- Next
- Dim line_SB1 = SketchBuilder.MakeLine(New GPnt(0, 0, 0), New GPnt(pocessor.plate_Length * 0.1, 0, 0))
- mRenderView.ShowSceneNode(BrepSceneNode.Create(line_SB1, material_plate, material_plate))
- Dim line_SB2 = SketchBuilder.MakeLine(New GPnt(pocessor.plate_Length * 0.1, 0, 0), New GPnt(pocessor.plate_Length * 0.1, pocessor.plate_Width * 0.1, 0))
- mRenderView.ShowSceneNode(BrepSceneNode.Create(line_SB2, material_plate, material_plate))
- Dim line_SB3 = SketchBuilder.MakeLine(New GPnt(pocessor.plate_Length * 0.1, pocessor.plate_Width * 0.1, 0), New GPnt(0, pocessor.plate_Width * 0.1, 0))
- mRenderView.ShowSceneNode(BrepSceneNode.Create(line_SB3, material_plate, material_plate))
- Dim line_SB4 = SketchBuilder.MakeLine(New GPnt(0, pocessor.plate_Width * 0.1, 0), New GPnt(0, 0, 0))
- mRenderView.ShowSceneNode(BrepSceneNode.Create(line_SB4, material_plate, material_plate))
- mRenderView.ZoomAll()
- End If
- End Sub
复制代码
-->
5.显示效果如下
-->
-->
-->
6.花两个小时搞定,ANYCAD功能引大,多花点时间,其实可以可以把做成3D的,并可以把每个边的坡口都可以做进去,进行显示。如果有客户有需求的可以搞搞。
-->
今天晚上没事做,研究了一下,做成立体的零件
-->
在立体面上,增加划线功能。并把切割引点加上。
ANYCAD,还有模拟仿真,应该可以做出销切割机的仿真切割。
-->
-->
|
-
|