Part-o-magic [New: Selection tools, container duplication]

Need help, or want to share a macro? Post here!
User avatar
easyw-fc
Posts: 2803
Joined: Thu Jul 09, 2015 9:34 am

Re: Part-o-magic [New tool: MUX Assembly]

Post by easyw-fc » Tue May 29, 2018 9:51 pm

DeepSOIC wrote:
Tue May 29, 2018 9:05 pm
Ugh, I know you love colors :P but I still haven't looked into if it is possible to copy face colors with python.
Ahahah I know ... :D

Code: Select all

Gui.ActiveDocument.YourObj.DiffuseColor
will give you the diffuse color for all faces or for each single face depending on the object properties...
If

Code: Select all

len(Gui.ActiveDocument.YourObj.DiffuseColor) != len (App.ActiveDocument.YourObj.Shape.Faces)
then your obj has a single color for all the faces, else it has different color for faces
User avatar
easyw-fc
Posts: 2803
Joined: Thu Jul 09, 2015 9:34 am

Re: Part-o-magic [New tool: X-ray]

Post by easyw-fc » Wed May 30, 2018 9:29 am

DeepSOIC wrote:
Tue May 29, 2018 4:56 pm
New feature:
* MUX assembly
Copies all shapes from Part hierarchy into a compound of same hierarchy. Supports exculsion list (names), compound flattening (for fusion), and is ghost-like (takes container placements into account).
first report ...
1) When I make a Cut of the attached file, the Mux thing behaves differently from a Cut made with a Union-ed object
Mux-cutting.png
Mux-cutting.png (195.42 KiB) Viewed 627 times
2) if I make a Mux of a Part, then I cannot do any more a DeepCopy without deleting the Mux thing... is that related to an observer?

here the file
Part-in-Part-Cut.FCStd
(21.22 KiB) Downloaded 18 times
Thx again
Maurice
User avatar
DeepSOIC
Posts: 7479
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Part-o-magic [New tool: X-ray]

Post by DeepSOIC » Wed May 30, 2018 9:50 am

easyw-fc wrote:
Wed May 30, 2018 9:29 am
first report ...
1) When I make a Cut of the attached file, the Mux thing behaves differently from a Cut made with a Union-ed object
Mux-cutting.png
MUX is a self-intersecting compound. You should not use these for boolean operations directly.

To achieve the result you did with fusion, you should:
1. Set MUX.FlattenCompound = True
This un-nests the compound. Necessary, because fusion only takes children of the topmost compound.
2. Part Union the MUX. This will merge all solids
3. Part Cut Fusion with Cone.


As for deep copy -- no idea... MUX should not interfere with Observer in any special manner.
User avatar
DeepSOIC
Posts: 7479
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Part-o-magic [New tool: MUX Assembly]

Post by DeepSOIC » Wed May 30, 2018 9:55 am

I feel like making a dedicated "Fuse Part" tool is worth it. Because the thing I suggested is hard to come up with.
User avatar
easyw-fc
Posts: 2803
Joined: Thu Jul 09, 2015 9:34 am

Re: Part-o-magic [New tool: MUX Assembly]

Post by easyw-fc » Wed May 30, 2018 10:32 am

DeepSOIC wrote:
Wed May 30, 2018 9:55 am
I feel like making a dedicated "Fuse Part" tool is worth it. Because the thing I suggested is hard to come up with.
that sounds good!
DeepSOIC wrote:
Wed May 30, 2018 9:50 am
As for deep copy -- no idea... MUX should not interfere with Observer in any special manner.
I will have a look at.. thx for clarification
EDIT: it was related to my way to exclude some InListRecursive objects, and MUX is going into this list for the muxed obj :)
User avatar
easyw-fc
Posts: 2803
Joined: Thu Jul 09, 2015 9:34 am

Re: Part-o-magic [New tool: X-ray]

Post by easyw-fc » Thu May 31, 2018 9:17 pm

some more test of this new feature:
DeepSOIC wrote:
Wed May 30, 2018 9:50 am
To achieve the result you did with fusion, you should:
1. Set MUX.FlattenCompound = True
This un-nests the compound. Necessary, because fusion only takes children of the topmost compound.
2. Part Union the MUX. This will merge all solids
I noticed this is not working when a Part Extrusion of a Sketch is inside a MUX... Part Union will give a MultiFusion failure
User avatar
DeepSOIC
Posts: 7479
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Part-o-magic [New tool: MUX Assembly]

Post by DeepSOIC » Fri Jun 01, 2018 1:24 am

easyw-fc wrote:
Thu May 31, 2018 9:17 pm
I noticed this is not working when a Part Extrusion of a Sketch is inside a MUX... Part Union will give a MultiFusion failure
That is because Sketch is a child of Part too, and thus is included in compound. Fusion then fails, because it refuses to merge shapes of different dimensional kinds (solids + wires in this case).

Your options are:
1. put the extrude and the sketch into a Module container
OR
2. add the sketch to exclusion list of the MUX
OR
3. filter the MUX with Lattice Downgrade to solids.
IMO 1 is best, in combo with 2 for master sketches. I plan adding a filter property for MUX to deal with 2 in automated manner.
User avatar
easyw-fc
Posts: 2803
Joined: Thu Jul 09, 2015 9:34 am

Re: Part-o-magic [New tool: MUX Assembly]

Post by easyw-fc » Fri Jun 01, 2018 7:36 am

DeepSOIC wrote:
Fri Jun 01, 2018 1:24 am
Your options are:
1. put the extrude and the sketch into a Module container
OR
2. add the sketch to exclusion list of the MUX
OR
3. filter the MUX with Lattice Downgrade to solids.
IMO 1 is best, in combo with 2 for master sketches. I plan adding a filter property for MUX to deal with 2 in automated manner.
I didn't know about the Exclusion List... very useful
...
In some user case an automatic exclusion may not be useful (i.e. when you export the MUX the sketch/wire may be useful)... may be an option as a python parameter...
Thx again ... this MUX container is getting very interesting... :)
User avatar
Kunda1
Posts: 7070
Joined: Thu Jan 05, 2017 9:03 pm

Re: Part-o-magic [New tool: MUX Assembly]

Post by Kunda1 » Tue Oct 02, 2018 11:50 am

This workbench is awesome, we need to really get it documented!
https://github.com/DeepSOIC/Part-o-magic/issues/25
There is a lot in this thread that help get that started. Any volunteers to help make that happen?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
easyw-fc
Posts: 2803
Joined: Thu Jul 09, 2015 9:34 am

Re: Part-o-magic [New tool: MUX Assembly]

Post by easyw-fc » Mon Oct 08, 2018 10:02 am

Kunda1 wrote:
Tue Oct 02, 2018 11:50 am
This workbench is awesome ...
fixing py3 compatibility
https://github.com/DeepSOIC/Part-o-magic/pull/26
Locked

Who is online

Users browsing this forum: No registered users and 1 guest