Topological Naming, My Take

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
OficineRobotica
Posts: 433
Joined: Thu Feb 21, 2019 8:17 am
Contact:

Re: Topological Naming, My Take

Post by OficineRobotica »

realthunder wrote: Fri Sep 25, 2020 9:13 am
I suspect that OCC 7.4 has done something to fillet, which makes it work on some cases that are previously not possible, but also brings some side effect.
:D Do we have hope for powerfull fillets in FC?
There is surely something different about fillet. I mean, look at what it is able to handle in only one operation. From my experimenting, the order of selection of the edges to be filleted is important for success. In this example it will fail if I select first the main circular edge, where the tube meets the plate, but it will do it if i select first edges under the boolean then the circular one. All in one fillet feature.

Also it will still give problems if Fillet005 is done prior in the model, even after a recompute as you told me to do. It will work first but if I go ahead and add features to the model it will eventually break as before and a recompute won't solve the problem. It works only if I suppress Fillet005 or if I move it at the end of the stack(fillet as last feature in the model)
boolean2.jpeg
boolean2.jpeg (267.62 KiB) Viewed 2935 times
Check out my Youtube channel at: https://www.youtube.com/@OficineRobotica
User avatar
OficineRobotica
Posts: 433
Joined: Thu Feb 21, 2019 8:17 am
Contact:

Re: Topological Naming, My Take

Post by OficineRobotica »

I found a strange behavior in the color setting process for the attached file.
The "Part" container has 3 bodies based on 3 Draft downgraded solids so the prior process of creation should not have a influence on the DAG(I guess).

Doing a CTRL-D on the "base" and setting the color everything worked as expected.

Doing a CTRL-D on the "belt" does nothing. Doing a "set colors" on the "Thickness001" inside belt will set colors after faces are selected. Note that there is "Thickness001" other than "BaseFeature001"

Doing CTRL-D on the "Top" does nothing. Doing "set colors" on the "BaseFeature" of "Top" will automagically set all faces color to the color that I tried to set with CTRL-D previously .

It gets confusing triyng to make sense of what should I touch to set the desired colors lol.
Colors.jpeg
Colors.jpeg (201.58 KiB) Viewed 2838 times
Check out my Youtube channel at: https://www.youtube.com/@OficineRobotica
User avatar
OficineRobotica
Posts: 433
Joined: Thu Feb 21, 2019 8:17 am
Contact:

Re: Topological Naming, My Take

Post by OficineRobotica »

I don't know why the file wasn't attached the first time
Attachments
pencylSharpner.FCStd
(541.4 KiB) Downloaded 64 times
Check out my Youtube channel at: https://www.youtube.com/@OficineRobotica
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Topological Naming, My Take

Post by realthunder »

OficineRobotica wrote: Sun Sep 27, 2020 7:02 am I found a strange behavior in the color setting process for the attached file.
The "Part" container has 3 bodies based on 3 Draft downgraded solids so the prior process of creation should not have a influence on the DAG(I guess).
You should be able to set "belt" color the way you described. I mean by simply setting the color of the body. The logic of setting color of a Body is to change the color of its tip feature. Probably "Thickness001" is not the tip when you set the color? For body "top", BaseFeature is not considered as a tip. I'll fix that.

Setting color of individual features inside body may feel a bit counter intuitive right now. Note that upstream PartDesign does not allow setting color of individual colors, because of undesired color change due to topo naming issue. I have changed that to stabilize the coloring, to some extent. There are a few view properties in each Part/PartDesign feature to control how to map color from its source. By default, the ShapeColor of each feature only specifies the color of newly generated shape elements of the current feature. If the element can be traced from its source, then the source color will be used. To disable color mapping, you can change that feature's MapFaceColor to False. You can also opt to specify individual face/line/point color, by right click the feature and select 'Set colors...'.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
OficineRobotica
Posts: 433
Joined: Thu Feb 21, 2019 8:17 am
Contact:

Re: Topological Naming, My Take

Post by OficineRobotica »

Thank you for looking into this.

Also, if it can give you some more clues, in the state that the file it is right now:
For body "belt", although there was a previously set color with no effect, re doing CTRL-D and changing the color value will now work but the color value needs to change. If I only re select the same previous color will have no effect.

Doing the same procedure on body "Top" will not work. Doing a CTRL-D on its "BaseFeature" will work tough and the next features in the model will preserve the color. Perhaps as you already said is because "BaseFeature" is not the tip.

BR
Check out my Youtube channel at: https://www.youtube.com/@OficineRobotica
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Topological Naming, My Take

Post by realthunder »

OficineRobotica wrote: Sun Sep 27, 2020 6:50 pm Also, if it can give you some more clues, in the state that the file it is right now:
For body "belt", although there was a previously set color with no effect, re doing CTRL-D and changing the color value will now work but the color value needs to change. If I only re select the same previous color will have no effect.
I notice that if the color don't change, the dialog won't touch the ShapeColor property. That's not really a problem. The real problem is how do you get to this state. Can you remember the steps? I mean for the 'belt' body, its ShapeColor has been changed, while Thickness001.ViewObject.ShapeColor is changed to the same, Thickness001.ViewObject.MapColor is still 'True'. What my code does is if body ShapeColor is set, it will copy the same color to the tip feature, and change tip's MapColor to 'False'. If it is left as 'True', then the tip still inherits most if not all the colors from previous feature.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
OficineRobotica
Posts: 433
Joined: Thu Feb 21, 2019 8:17 am
Contact:

Re: Topological Naming, My Take

Post by OficineRobotica »

realthunder wrote: Sun Sep 27, 2020 11:23 pm Can you remember the steps?
I made a quick video where you can see the steps to bring the model in to that state. What I noticed is that colors start to misbehave after a draft downgrade is performed on the slices(see video). This is strange because I thought that the simple geometry of the generated solids will have it's own independent set of data.

If, on the other hand, I create part design body based directly on the slices , colors will work as expected. See video from minute 4.16 What I noticed is that the "BaseFeature" icon is different also in this case. With this second technique the model is even parametric but it should work correctly even if the base feature is a simple solid.

phpBB [video]
Check out my Youtube channel at: https://www.youtube.com/@OficineRobotica
User avatar
OficineRobotica
Posts: 433
Joined: Thu Feb 21, 2019 8:17 am
Contact:

Re: Topological Naming, My Take

Post by OficineRobotica »

P.S.
If part design "Pad" would be able to extrude wires (or single line sketch) wouldn't the "Split the previous feature in to multiple solids" be able to do this model all inside the part design workbench instead of jumping between various workbenches? How cool would that be as workflow.

I would see this as a streamlined and intuitive workflow:
1-create the main "body"
2-inside the body(or outside?) create the slicing sketch and pad it
3-selet "body" then CTRL-select "sketch"
4-boolean "Split the previous feature in to multiple solids"
5-two different bodies are created,with their own coordinate system, sliced where the "sketch" is positioned

Just a thought :D
We keep on asking. I see the boolean option in the part design workbench as a indispensable tool now. Thank you for implementing it.
Check out my Youtube channel at: https://www.youtube.com/@OficineRobotica
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Topological Naming, My Take

Post by realthunder »

OficineRobotica wrote: Mon Sep 28, 2020 9:02 am If, on the other hand, I create part design body based directly on the slices , colors will work as expected. See video from minute 4.16 What I noticed is that the "BaseFeature" icon is different also in this case. With this second technique the model is even parametric but it should work correctly even if the base feature is a simple solid.
The green icon means the base feature is brought in using my SubShapeBinder. Currently, it is used if you bring any object that is inside either an App::Part or PartDesign::Body. SubShapeBinder will take care of cross coordinate system placement tracking. The SubShapeBinder, when used for BaseFeature or Reference (in Boolean) also has MapFaceColor turned on by default. So it will get its color from its source objects. I will modify the code to turn off color mapping when the user manually sets the shape color.

OficineRobotica wrote: Mon Sep 28, 2020 9:28 am If part design "Pad" would be able to extrude wires (or single line sketch) wouldn't the "Split the previous feature in to multiple solids" be able to do this model all inside the part design workbench instead of jumping between various workbenches? How cool would that be as workflow.
I just checked code. Doing wire extrusion using pad is pretty straight forward. However, it is a bit complicated to manage the generated face. We can't treat it like normal Pad feature which expects a solid, and we shouldn't combine the shape with the previous tip, because combine face with solids makes little sense. The generated shape should be treated like a binder or sketch. Or, maybe like Catia, group them under some folder named 'Geometry', or something like that.

Anyway, even if you can't extrude wire in PartDesign right now, you can, however, do slice using my newly added 'Split' feature. You can import the slicing face into body using SubShapeBinder. By default, the first sliced solid is used as the new tip. You can double click to enable/disable other solids. Or, create another body using those solids as base.
Screenshot from 2020-09-29 15-18-52.png
Screenshot from 2020-09-29 15-18-52.png (15.13 KiB) Viewed 2469 times
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
C_h_o_p_i_n
Posts: 225
Joined: Fri Apr 26, 2019 3:14 pm

Re: Topological Naming, My Take

Post by C_h_o_p_i_n »

@realthunder,

might it be that the split feature does only work with a face right now ?

I recently tried to split a body using a second body due to I were needing some clearence between the resulting Bodys...
( I tried this, using your Freecad built from july )

regards,
Stefan
Post Reply