Part.Wire misses some Edges

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Part.Wire misses some Edges

Post by bernd »

I would like to make ONE Wire out of ALL Edges from the Screen and file attached. For some reason some Edges are missing (pink in the second screen is the wire). What I did:

Code: Select all

Part.show(Part.Wire(App.ActiveDocument.Compound.Shape.Edges))
Does someone has an idea how to make an wire out of the edges with OCCT >= 6.9 or how to trackle down the problem of the missing Edges.

BTW: Is it called non-manifold wire or is this term only used on faces and shells?
nonmanifold_wire.fcstd
(46.99 KiB) Downloaded 33 times
screen.jpg
screen.jpg (70.27 KiB) Viewed 1903 times
screen1.jpg
screen1.jpg (97.18 KiB) Viewed 1903 times
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Part.Wire misses some Edges

Post by microelly2 »

What happens when you first order the edges so that consecutive ones have common endpoints?
It will happen that you need to add some edges more than once because your figures is not a euler graph.
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: Part.Wire misses some Edges

Post by chrisb »

Which FreeCAD version do you use?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: Part.Wire misses some Edges

Post by chrisb »

(Seems to independent from the current FreeCAD versions.)
microcelly2 is right: If you select arbitrary paths through your network without having more than 2 lines at one vertex, the upgrade tool creates a path wire. If I connect several of these wires I get a block.

Edit in blue
Last edited by chrisb on Fri May 19, 2017 3:55 pm, edited 1 time in total.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
tanderson69
Veteran
Posts: 1626
Joined: Thu Feb 18, 2010 1:07 am

Re: Part.Wire misses some Edges

Post by tanderson69 »

bernd wrote:I would like to make ONE Wire out of ALL Edges from the Screen and file attached.
What are your plans for this wire?

I can't speak for freecads python api, but you won't find much algorithmic support in occt for such a wire.
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Part.Wire misses some Edges

Post by DeepSOIC »

nonmanifold_wire_DeepSOIC.fcstd
(49.17 KiB) Downloaded 33 times
How to:
1. BooleanFragments
2. w = Part.Wire(booleanfragments.Shape.Edges)
3. for e in booleanfragments.Shape.Edges: w.add(e)

After step 2, I got a wire with some edges missing. Re-adding them to the wire seems to have worked.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Part.Wire misses some Edges

Post by bernd »

tanderson69 wrote:
bernd wrote:I would like to make ONE Wire out of ALL Edges from the Screen and file attached.
What are your plans for this wire?
If all Edges are connecte a Edgemesh generated with GMSH has connected Edges and is appropriate for an FEM calculation. It is like the CompSolids but just not in 3D (Solids vs CompSolids) but 1D instead (Edges vs. Wire). Same with Face and Shell you may remember we had a looooong discussion about the Shell some time ago before the BooleanFragments where available in FreeCAD.

@DeepSonic :D :mrgreen: works great here too!

BTW: with OCCT < 6.9 this could be made with a Fusion, good too know with OCCT >= 6.9 it could be made with the BooleanFragments :-)
nonmanifold_wire_DeepSOIC_FEM.fcstd
(107.78 KiB) Downloaded 36 times
screen.jpg
screen.jpg (181 KiB) Viewed 1838 times
User avatar
tanderson69
Veteran
Posts: 1626
Joined: Thu Feb 18, 2010 1:07 am

Re: Part.Wire misses some Edges

Post by tanderson69 »

Curious, what does gmsh do with a compound of 'connected' edges?
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Part.Wire misses some Edges

Post by bernd »

tanderson69 wrote:Curious, what does gmsh do with a compound of 'connected' edges?
Same what GMSH meshes if you pass a Compound of "connected" Solids instead of one CompSolid or if you pass a Compound of "connected" Faces instead of one Shell or a Compound of "connected" Edges instead of one Wire. GMSH will mesh them in one big mesh but will not connect them means for the connected Edges in the mesh there will be at a vertex where 3 Edges meat there will be three nodes. Each Edge will have his own node, thus the Edges are not connected. If you pass one wire GMSH will make one Vertex at the point where the three edges are connected. GMSH just meshes what it gets. Means you need to pass the wire as brep.

bernd
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Part.Wire misses some Edges

Post by bernd »

DeepSOIC wrote: How to:
1. BooleanFragments
2. w = Part.Wire(booleanfragments.Shape.Edges)
3. for e in booleanfragments.Shape.Edges: w.add(e)
.
All in Python. Load nonmanifold_wire.fcstd from first topic post

Code: Select all

import BOPTools.SplitFeatures
import Part
j = BOPTools.SplitFeatures.makeBooleanFragments(name='BooleanFragments')
j.Objects = App.ActiveDocument.Compound
j.Proxy.execute(j)
j.purgeTouched()
for obj in j.ViewObject.Proxy.claimChildren():
    obj.ViewObject.hide()

w = Part.Wire(j.Shape.Edges)
for e in j.Shape.Edges:
    w.add(e)

j.ViewObject.hide()
Part.show(w)
Post Reply