[in master] Test request: updated JoinFeatures,new tools BoolFragments, Slice, XOR
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
[in master] Test request: updated JoinFeatures,new tools BoolFragments, Slice, XOR
Hi!
I've been working on these for a few weeks already. The main goal was to port Connect to use generalFuse method, to make it faster. In the process, It became clear it's relatively easy to add a few more tools (which proved to be much more involved than I anticipated, but I did it .
Code:
https://github.com/DeepSOIC/FreeCAD-ell ... nFeatures4
I ask for some testing before I make a pull request.
Here's a brief list of what has happened:
* old JoinFeatures was changed to a deprecated state, where it is only capable of recomputing existing objects (using legacy algorithm).
* New JoinFeatures (Connect, Embed, Cutout) were implemented. They use the new generalFuse if OCC6.9.0, or fall back to legacy algorithm (less capable) if OCC is lower.
** Connect now supports multiple arguments
** Connect can take a (single) compound to act as a set of arguments (thus you can now connect self-intersecting Draft Arrays)
** Connect now works with shells/faces, and wires/edges. It might work with compsolids, too (I didn't test, it'll probably treat them as single solids).
** Connect now has Tolerance property (appears to break input shapes, so it probably should be avoided).
** Embed and Cutout are essentially unchanged. But try them on shells/faces and wires, and tell me if they work or not.
* new Split Tools: Boolean Fragments, Slice and XOR. These output compounds, and they need to be exploded to get the actual splitting. They work only if OCC is 6.9.0 and up.
** New tool: Boolean Fragments. This one is essentially generalFuse method exposed to Gui. BUT. It has Mode property, which alters its behavior. The most interesting mode is "CompSolid", which makes compsolids!
** New tool: Slice. It can split solids apart with a plane (for example). It can also "engrave" sketches onto faces of solids/whatever. It should accept a wide variety of inputs, from compsolids to vertices. Just try it, and tell me if it doesn't do what you expected.
It also has Mode property, which has "CompSolid" entry.
** New tool: Boolean XOR. That pretty much says it all. Although I doubt it will be very useful, I made it because it was easy (and it helped reveal a serious problem with the code)
API:
* the new JoinFeatures now have API to work on shapes. This API, as well as all the machinery that makes it work, is exposed as Part.BOPTools,* I hope this machinery will help create more BOP-like tools in the future!
I've been working on these for a few weeks already. The main goal was to port Connect to use generalFuse method, to make it faster. In the process, It became clear it's relatively easy to add a few more tools (which proved to be much more involved than I anticipated, but I did it .
Code:
https://github.com/DeepSOIC/FreeCAD-ell ... nFeatures4
I ask for some testing before I make a pull request.
Here's a brief list of what has happened:
* old JoinFeatures was changed to a deprecated state, where it is only capable of recomputing existing objects (using legacy algorithm).
* New JoinFeatures (Connect, Embed, Cutout) were implemented. They use the new generalFuse if OCC6.9.0, or fall back to legacy algorithm (less capable) if OCC is lower.
** Connect now supports multiple arguments
** Connect can take a (single) compound to act as a set of arguments (thus you can now connect self-intersecting Draft Arrays)
** Connect now works with shells/faces, and wires/edges. It might work with compsolids, too (I didn't test, it'll probably treat them as single solids).
** Connect now has Tolerance property (appears to break input shapes, so it probably should be avoided).
** Embed and Cutout are essentially unchanged. But try them on shells/faces and wires, and tell me if they work or not.
* new Split Tools: Boolean Fragments, Slice and XOR. These output compounds, and they need to be exploded to get the actual splitting. They work only if OCC is 6.9.0 and up.
** New tool: Boolean Fragments. This one is essentially generalFuse method exposed to Gui. BUT. It has Mode property, which alters its behavior. The most interesting mode is "CompSolid", which makes compsolids!
** New tool: Slice. It can split solids apart with a plane (for example). It can also "engrave" sketches onto faces of solids/whatever. It should accept a wide variety of inputs, from compsolids to vertices. Just try it, and tell me if it doesn't do what you expected.
It also has Mode property, which has "CompSolid" entry.
** New tool: Boolean XOR. That pretty much says it all. Although I doubt it will be very useful, I made it because it was easy (and it helped reveal a serious problem with the code)
API:
* the new JoinFeatures now have API to work on shapes. This API, as well as all the machinery that makes it work, is exposed as Part.BOPTools,* I hope this machinery will help create more BOP-like tools in the future!
Re: Test request: updated JoinFeatures,new tools BoolFragments, Slice, XOR
Nope. Not for me anyway.DeepSOIC wrote:New tool: Boolean XOR. That pretty much says it all.
Sounds very interesting. Quite a few people have enquired if FreeCAD had this functionality.DeepSOIC wrote:New tool: Slice. It can split solids apart with a plane (for example). It can also "engrave" sketches onto faces of solids/whatever.
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Test request: updated JoinFeatures,new tools BoolFragments, Slice, XOR
NormandC wrote:Nope. Not for me anyway.DeepSOIC wrote:New tool: Boolean XOR. That pretty much says it all.
Re: Test request: updated JoinFeatures,new tools BoolFragments, Slice, XOR
Still don't know what XOR stands for.
-
- Posts: 656
- Joined: Tue May 19, 2015 1:11 am
Re: Test request: updated JoinFeatures,new tools BoolFragments, Slice, XOR
https://en.wikipedia.org/wiki/Exclusive_or
Deepsoic: Is that a valid solid? It seems like some of those edges may violate the rule of number of faces per edge (I can't remember the rule specifically).
Deepsoic: Is that a valid solid? It seems like some of those edges may violate the rule of number of faces per edge (I can't remember the rule specifically).
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Test request: updated JoinFeatures,new tools BoolFragments, Slice, XOR
On the screenshot, there is no solid. It's a compound of faces on XY plane. But if you XOR some cylinders, you'll get a compound of solids. It passes BOPCheck, even though the solids/faces in the compound are touching.ezzieyguywuf wrote:Is that a valid solid? It seems like some of those edges may violate the rule of number of faces per edge (I can't remember the rule specifically).
It is usually considered invalid (invalid for BOP, to be specific) to have a compound of touching objects. Boolean fragments, Slice and XOR all create such compounds. Nevertheless, they pass BOPCheck, and can be put through further Boolean operations. I believe this is thanks to that things they touch with are shared.
http://www.opencascade.com/doc/occt-7.0 ... ithms_10_1
OCCT Guide wrote:The argument should not be self-interfered, i.e. all sub-shapes of the argument that have geometrical coincidence through any topological entities (vertices, edges, faces) should share these entities.
-
- Posts: 656
- Joined: Tue May 19, 2015 1:11 am
Re: Test request: updated JoinFeatures,new tools BoolFragments, Slice, XOR
Neat, sounds like you've done your homework. I can't say I have an immediate use for it, but I can definitely see why having these features would be helpful. Well done!
Re: Test request: updated JoinFeatures,new tools BoolFragments, Slice, XOR
Nicely done DeepSoic! I really love to see that Part Workbench gets all those specialized tools, that makes it ever more powerfull for advanced users! Together with a more streamlined user-friendly PartDesign IMHO this is a very good way for evolving FreeCAD!
Re: Test request: updated JoinFeatures,new tools BoolFragments, Slice, XOR
I am sure this will be ironed out over time but i feel we must not confuse features nobody really understand when reading the description with powerful features. And the use of substandard terminology doesn't really help here. Somebody said in the past if you can't explain it to a child you probably don't know what you are doing.ickby wrote:Nicely done DeepSoic! I really love to see that Part Workbench gets all those specialized tools, that makes it ever more powerfull for advanced users! Together with a more streamlined user-friendly PartDesign IMHO this is a very good way for evolving FreeCAD!
Therefore this is definitely something that will need additional attention in the future. That is putting the powerful features behind understandable use-cases and short and understandable description. Terminology should be human readable and workflow intuitive.
I do understand ATM things are explored and under heavy development. Therefore they can't be perfect. But as said in the future i would expect additional effort to be made to explain something to average FreeCAD users without loose ends. That is powerful in the end.
- tanderson69
- Veteran
- Posts: 1626
- Joined: Thu Feb 18, 2010 1:07 am
Re: Test request: updated JoinFeatures,new tools BoolFragments, Slice, XOR
great work DeepSoic! bernd is going to love this for his FEM compsolids.