[Solved]Projection of Wire on Mesh
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- HakanSeven12
- Veteran
- Posts: 1481
- Joined: Wed Feb 06, 2019 10:30 pm
Re: Projection of Wire on Mesh
I will try it
Support me: Hakan Seven on Patreon
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
- HakanSeven12
- Veteran
- Posts: 1481
- Joined: Wed Feb 06, 2019 10:30 pm
Re: Projection of Wire on Mesh
Yes most of it works but some of wire dont extend to edge. They stay last triangle edge.
Support me: Hakan Seven on Patreon
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
- HakanSeven12
- Veteran
- Posts: 1481
- Joined: Wed Feb 06, 2019 10:30 pm
Re: Projection of Wire on Mesh
I can create projected wire like this by using Mesh.crossSections. But I can't finish projected wire at base wire last point.
Code:
Code: Select all
import MeshPart, Draft
GuideLinesGroup = FreeCAD.ActiveDocument.Test.Group
SectionGroup = FreeCAD.ActiveDocument.Group
CopyMesh=App.ActiveDocument.Surface.Mesh.copy()
Base = CopyMesh.Placement.Base
CopyMesh.Placement.move(Base.negative())
for Wire in GuideLinesGroup:
CopyShape=Wire.Shape.copy()
CopyShape.Placement.move(Base.negative())
Vec = CopyShape.Edge1.Vertexes[0].Point - CopyShape.Edge1.Vertexes[1].Point
Vec.x, Vec.y = -(Vec.y), Vec.x
Section = CopyMesh.crossSections([(CopyShape.Edge1.Vertexes[0].Point,Vec)],0.000001)
print(Section)
for i in Section[0]:
Pwire = Draft.makeWire(i)
Pwire.Placement.move(Base)
SectionGroup.addObject(Pwire)
FreeCAD.ActiveDocument.recompute()
Support me: Hakan Seven on Patreon
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
Re: Projection of Wire on Mesh
With git commit 115ff0191 everything works now.
- HakanSeven12
- Veteran
- Posts: 1481
- Joined: Wed Feb 06, 2019 10:30 pm
Re: Projection of Wire on Mesh
Does same macro work or I need to change something?
Last edited by HakanSeven12 on Thu Jun 27, 2019 5:41 pm, edited 1 time in total.
Support me: Hakan Seven on Patreon
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
Re: Projection of Wire on Mesh
Same macro.
- HakanSeven12
- Veteran
- Posts: 1481
- Joined: Wed Feb 06, 2019 10:30 pm
Re: Projection of Wire on Mesh
Okey I will try when next build available
Support me: Hakan Seven on Patreon
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
- HakanSeven12
- Veteran
- Posts: 1481
- Joined: Wed Feb 06, 2019 10:30 pm
Re: Projection of Wire on Mesh
Support me: Hakan Seven on Patreon
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum