Feature creation change; could fix topo naming errors

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!
freedman
Posts: 865
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Feature creation change; could fix topo naming errors

Postby freedman » Tue Sep 17, 2019 6:30 am

After 3 hours of trying everything I could think of, I have a procedure that is topo-error immune and parametric. :o

First, this is how I test for a topo error (all in Part design). Sketch and pad a solid cube, click on the top cube face and sketch and pad a feature on that face. Then go back to my first solid and change it from a cube to a hexagon. This is guaranteed to create a topo error every time because of the new faces created in the first feature, the face numbering gets all screwed up.

I won't go thru my thought process but it brought me to this; Creating a sketch and pad/pocket is a bad thing, we loose control of the faces, if instead we create two identical sketches, offset one of them (on the z axis) and then loft between them. What we get from a loft is two faces (top and bottom), this is fix #1 because now we have two faces of a solid that can't be renumbered (top and bottom). Fix #2 is the fact that because the solid is a loft of two sketches we now control the faces of the sketches, if we add more sketch edges then it will be obvious what face things are attached to and of coarse will need to be reattached.

One thing I found was to attach a sketch to a loft I had to create a datum plane.

The way I see this; someone could code up creating features with lofts instead of padding and pockets, it appears (so far) that would fix topo errors. I'm also sure it's not that simple but this has merit.

Attached my sample file.
Attachments
loft_topo_check2.FCStd
(38.67 KiB) Downloaded 4 times
Last edited by freedman on Tue Sep 17, 2019 4:50 pm, edited 1 time in total.
chrisb
Posts: 18003
Joined: Tue Mar 17, 2015 9:14 am

Re: Feature creation change; could fix topo naming errors

Postby chrisb » Tue Sep 17, 2019 10:22 am

Interesting method, and as a further possibility sure to be considered. As an addon it gives some insights how Loft works.
However, the first choice should be to use the simplest possible features, which are pads and pockets, followed by revolve and grove and at the end come loft and sweep.
You have noticed it yourself: Loft does not always yield planar faces, or to be more precise: OCC does not recognize them as such. So the additional effort of creating a DatumPlane is not easier than to use an expression for the offset.
openBrain
Posts: 1959
Joined: Fri Nov 09, 2018 5:38 pm

Re: Feature creation change; could fix topo naming errors

Postby openBrain » Tue Sep 17, 2019 11:04 am

Honestly, I doubt this method will have some interest.
It looks to me as it has too more disadvantages :
  • This is only partially immune to topo naming. Only top & bottom faces seems to be robust (and eventually it may change in the future depending on how Loft is implemented. Moreover it seems to me more complicated and time-consuming than positioning sketches with expressions, which brings the same robustness
  • You have to draw 2 times each sketch. Each modification is also doubled. Notice you can solve this point using the "new" SubShapeBinder tool (which I admit is really great)
  • Compared to eg. Pad, setting the length is definitely complicated because you have to use Placement. Moreover you loose benefit of many interesting things such as 'Through all', 'Up to face', 'Up to First', ...
  • Loft feature tends to create Spline surfaces which creates inaccuracy and further issues when modeling. That's the reason why you have to create Datum planes.
ATM I can't sincerely see no improvement in this method compared to known ones. ;)
chrisb
Posts: 18003
Joined: Tue Mar 17, 2015 9:14 am

Re: Feature creation change; could fix topo naming errors

Postby chrisb » Tue Sep 17, 2019 12:33 pm

openBrain wrote:
Tue Sep 17, 2019 11:04 am
You have to draw 2 times each sketch. Each modification is also doubled.
Although I don't advocate that Loft method at least the doubling can be avoided by using a Draft->Clone of the sketch. Watch out to move the clone into the body.
openBrain
Posts: 1959
Joined: Fri Nov 09, 2018 5:38 pm

Re: Feature creation change; could fix topo naming errors

Postby openBrain » Tue Sep 17, 2019 12:48 pm

chrisb wrote:
Tue Sep 17, 2019 12:33 pm
Although I don't advocate that Loft method at least the doubling can be avoided by using a Draft->Clone of the sketch. Watch out to move the clone into the body.
Could you tell me a bit more about why the Draft/Clone would be better to use than the recent SubShapeBinder tool ? Thx
freedman
Posts: 865
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Feature creation change; could fix topo naming errors

Postby freedman » Tue Sep 17, 2019 3:51 pm

You have noticed it yourself: Loft does not always yield planar faces, or to be more precise: OCC does not recognize them as such. So the additional effort of creating a DatumPlane is not easier than to use an expression for the offset.
and
Moreover it seems to me more complicated and time-consuming
My comments are about a concept, not use FreeCAD this way (but you could). Just a concept for topo fix, parametrics and FreeCAD2. For instance, if FreeCAD2 always used two sketches to make pads and pockets in it's normal operation and OCC could make planar faces, that might be something to look at. If all pads/pockets were made of two sketches there would also be a lot more control of the solid in one item of the tree.

I'm really just testing and working with what I have. :) This concept isolates OCC from messing with other parts of the solid on two faces, I think that's a big deal. Of coarse there are the sides to deal with, are they renumbered by OCC in a single loft, not sure yet. I'm also not sure what we expect if the user changes a square to a hexagon, your going to remap some stuff.....

Anyway, this was fun and I learned a lot about topo naming and lofts.
chrisb
Posts: 18003
Joined: Tue Mar 17, 2015 9:14 am

Re: Feature creation change; could fix topo naming errors

Postby chrisb » Tue Sep 17, 2019 4:28 pm

openBrain wrote:
Tue Sep 17, 2019 12:48 pm
Could you tell me a bit more about why the Draft/Clone would be better to use than the recent SubShapeBinder tool ? Thx
Sorry no, I can't. I don't even know which one is better, because I'm not familiar with the SubShapeBinder yet.
freedman
Posts: 865
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Feature creation change; could fix topo naming errors

Postby freedman » Tue Sep 17, 2019 8:53 pm

In case anyone is following this; I have been creating many sketches on my loft. I thought I had to put datum planes on a face but I guess that isn't true all the time, only when the face is a complex shape, mapping sketches to a face works fine if the face is flat. I also found that a copy and paste works well but a clone changes the solid as a whole and I get topo errors.

This is really fun, it's nice to see real parametric solids work.