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: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Part.Wire misses some Edges

Post by bernd »

tanderson69 wrote: Sat May 27, 2017 10:32 pm
bernd wrote: Sat May 27, 2017 10:15 pm Exactly ! Thats the magical thing and it works on nonmanifold shells too. Just pass a bound of faces as a BooleanFragmentsCompound to gmsh and the faces in the mesh will be glued !
That is what I thought, and that is what my first question was about. Thanks.
Do you know why does the BooleanFragmentsCompound glues the Elements together in the OCCT mesher GMSH, or do you know some resources about this. I assume the reason for this is in OCCTs BooleanFragmentsCompound.

I have been testing the next step in all this gluing stuff. Mixed glued meshes of Volumes and Faces (interesting for some guys around in FEM) or Faces and Beams (interesting for me in the regard of building structure analysis) by the use of BooleanFragmentsCompounds. But I would not like to bring in to much at once ... But again it is all about these BooleanFragments ...
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: Sat May 27, 2017 10:52 pmDo you know why does the BooleanFragmentsCompound glues the Elements together in the OCCT mesher GMSH, or do you know some resources about this. I assume the reason for this is in OCCTs BooleanFragmentsCompound.
Just because 2 vertices, on 2 different edges, share the same position in 3d space doesn't mean the edges are 'connected'. The 2 edges need to share the actual vertex.


I extracted 2 adjacent edges from the default cube. Then added the edges to a compound and ran the compound through check geometry.
compound.png
compound.png (24.47 KiB) Viewed 2393 times

Then took extracted edges and ran them through a fusion and ran the fusion through check geometry.
fusion.png
fusion.png (25.76 KiB) Viewed 2393 times

notice the vertex numbers. That is it.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Part.Wire misses some Edges

Post by bernd »

ahh sure the cound of vertices, edges and faces shows if shapes share vertices and thus are glued to each other. It is what I assumed. GMSH meshes what it gets. Means the topology is glued together already. Glued and connect are not that good words. You described it much better, they share topology. If Shapes share vertices in geometry they gone share these vertices in the mesh and the mesh is glued, no magical. Back to the magical BooleanFragments. For some reason no matter what is passed to a BooleanFragment the Elements share Vertices and Edges. Thats wonderful for FEM topology. Attached two more simple example:

your two edges run to a BooleanFragment --> 3 Vertices --> the edges share a Vertex
screen.jpg
screen.jpg (25.12 KiB) Viewed 2381 times


three faces run through BooleanFragment --> two Vertices and only 4 Edges --> the three faces share one edge --> YEAH
screen1.jpg
screen1.jpg (37.01 KiB) Viewed 2381 times



EDIT:
It seams BooleanFragments does make shared Vertices, Edges and Faces by default. Still I'd be interested in some more resources in this regard.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Part.Wire misses some Edges

Post by bernd »

a more sophisticated example. 3 faces and 3 edges, run through a BooleanFragment. YEAH they share the Vertices and the Edges ...

The Boolean Fragment only has 2 vertices and 7 Edges (6 Circles and the one they all share) :D

screen.jpg
screen.jpg (38.45 KiB) Viewed 2373 times

edges-faces-shared-topology.fcstd
(13.7 KiB) Downloaded 37 times
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Part.Wire misses some Edges

Post by bernd »

bernd wrote: Sun May 28, 2017 9:35 am It seams BooleanFragments does make shared Vertices, Edges and Faces by default. Still I'd be interested in some more resources in this regard.
Just to proof this for the faces too.

attached two cubes run through a Boolean Fragment. They have shared faces, edges and vertices. That is why they are glued in meshing even if no CompSolid is made out of the BooleanFragment. This all means the magical for FEM are not the CompSolids, the magical is the BooleanFragment !

two solids, 12 vertices (4 shared), 20 Edges (4 shared), 11faces (one shared)
screen.jpg
screen.jpg (32.22 KiB) Viewed 2369 times
:D
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Part.Wire misses some Edges

Post by bernd »

another example ... The BooleanFragments does not only the sharing, it does create new edges and faces if they are needed to make the shared topology. Attached an example of 3 faces run through a BooleanFragment
screen.jpg
screen.jpg (30.85 KiB) Viewed 2362 times


If the base face is extracted from the BooleanFragment one can see it has the edges. Very important to make a valid FEM mesh out of the BooleanFragment. :D
screen1.jpg
screen1.jpg (25.7 KiB) Viewed 2362 times
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: Sun May 28, 2017 9:35 amIt seams BooleanFragments does make shared Vertices, Edges and Faces by default. Still I'd be interested in some more resources in this regard.
Not sure what you want, but it looks like the relevant code that deepsoic wrote is in src/Mod/Part/BOPTools
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Part.Wire misses some Edges

Post by bernd »

tanderson69 wrote: Sun May 28, 2017 1:29 pm
bernd wrote: Sun May 28, 2017 9:35 amIt seams BooleanFragments does make shared Vertices, Edges and Faces by default. Still I'd be interested in some more resources in this regard.
Not sure what you want, but it looks like the relevant code that deepsoic wrote is in src/Mod/Part/BOPTools
BooleanFragments are not some FreeCAD thing they are originated in OCCT. Means like for a fuse for a BooleanFragment everything seams passed to OCCT and OCCT returns the result. Means the answer seams to be find in OCCT not in FreeCAD. Ahh here is where the magic starts ...

https://github.com/FreeCAD/FreeCAD/blob ... res.py#L86
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Part.Wire misses some Edges

Post by bernd »

@tanderson69: again you are better than me ...

What we are talking about seam called generalFuse ...

https://github.com/FreeCAD/FreeCAD/blob ... py#L46-L48

and here it goes to OCCT

https://github.com/FreeCAD/FreeCAD/blob ... 1644-L1655
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: Sun May 28, 2017 1:46 pmBooleanFragments are not some FreeCAD thing they are originated in OCCT.
https://dev.opencascade.org/doc/overvie ... gorithms_7
Post Reply