[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
[Solved]Projection of Wire on Mesh
How can I create a parallel projection of a wire on a mesh surface like this?
(Green line is mesh, red one is projected wire and black one is first wire)
(Green line is mesh, red one is projected wire and black one is first wire)
Last edited by HakanSeven12 on Sun Sep 08, 2019 7:00 pm, edited 4 times 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
- Joel_graff
- Veteran
- Posts: 1949
- Joined: Fri Apr 28, 2017 4:23 pm
- Contact:
Re: Projection of Wire on Mesh
@microelly2 can probably answer that one.
microelly2 wrote: ping
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
Re: Projection of Wire on Mesh
maybe a solution would be : Extrude a wire or edge with Part -> convert to mesh via STL -> mesh.intersect(STL)
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: Projection of Wire on Mesh
First convert the mesh to a part
than you can apply the makeParallelProjection method to each face and your wire
>>> f=App.ActiveDocument.Box.Shape.Face1
>>> f.makeParallelProjection.__doc__
'Parallel projection of an edge or wire on this shape\nmakeParallelProjection(shape, dir)\n '
>>> f.makePerspectiveProjection.__doc__
'Perspective projection of an edge or wire on this shape\nmakePerspectiveProjection(shape, pnt)\n '
see for more discussion here
https://forum.freecadweb.org/viewtopic.php?t=5360
than you can apply the makeParallelProjection method to each face and your wire
>>> f=App.ActiveDocument.Box.Shape.Face1
>>> f.makeParallelProjection.__doc__
'Parallel projection of an edge or wire on this shape\nmakeParallelProjection(shape, dir)\n '
>>> f.makePerspectiveProjection.__doc__
'Perspective projection of an edge or wire on this shape\nmakePerspectiveProjection(shape, pnt)\n '
see for more discussion here
https://forum.freecadweb.org/viewtopic.php?t=5360
Re: Projection of Wire on Mesh
git commit c60658f3f
Code: Select all
shape = ...
mesh = ...
projectionDir = App.Vector(...)
import MeshPart
import Part
polylines = MeshPart.projectShapeOnMesh(shape, mesh, projectionDir)
for i in polylines:
Part.show(Part.makePolygon(i))
- HakanSeven12
- Veteran
- Posts: 1481
- Joined: Wed Feb 06, 2019 10:30 pm
Re: Projection of Wire on Mesh
I will try it when next 0.19_pre build is available
Last edited by HakanSeven12 on Sun May 19, 2019 10:16 am, 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
- HakanSeven12
- Veteran
- Posts: 1481
- Joined: Wed Feb 06, 2019 10:30 pm
Re: Projection of Wire on Mesh
I tried it. If all wire points drop on mesh its create projection wires. But if wire points does not drop on mesh its return empty list.wmayer wrote: ↑Tue May 14, 2019 1:24 pm git commit c60658f3fCode: Select all
shape = ... mesh = ... projectionDir = App.Vector(...) import MeshPart import Part polylines = MeshPart.projectShapeOnMesh(shape, mesh, projectionDir) for i in polylines: Part.show(Part.makePolygon(i))
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 will try it in the next windows build
Last edited by HakanSeven12 on Tue May 28, 2019 11:34 am, 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
- HakanSeven12
- Veteran
- Posts: 1481
- Joined: Wed Feb 06, 2019 10:30 pm
Re: Projection of Wire on Mesh
I tried. We talked about it but for topic:
Funchtion is creating projection if wire edge down on mesh, but if wire edge lie outside of mesh projection wire dont extend to mesh border.
Like this(Black one is original wire under mesh and red one is projected wire)
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