Padding more than 1 shape within same sketch

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Padding more than 1 shape within same sketch

Post by TheMarkster »

Consider this sketch:
Snip macro screenshot-39dd1a.png
Snip macro screenshot-39dd1a.png (58.97 KiB) Viewed 2320 times
and how I padded it with 2 pads:
Snip macro screenshot-272231.png
Snip macro screenshot-272231.png (43.62 KiB) Viewed 2320 times
Attachments
pad 2 shapes 1 sketch.FCStd
(15.88 KiB) Downloaded 38 times
drmacro
Veteran
Posts: 8870
Joined: Sun Mar 02, 2014 4:35 pm

Re: Padding more than 1 shape within same sketch

Post by drmacro »

TheMarkster wrote: Thu Dec 30, 2021 11:54 pm Consider this sketch:
...
and how I padded it with 2 pads:
...
You better explain...many will be confused. 8-)
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
drmacro
Veteran
Posts: 8870
Joined: Sun Mar 02, 2014 4:35 pm

Re: Padding more than 1 shape within same sketch

Post by drmacro »

TheMarkster wrote: Thu Dec 30, 2021 11:54 pm Consider this sketch:

Snip macro screenshot-39dd1a.png

and how I padded it with 2 pads:

Snip macro screenshot-272231.png
Why didn't you use WireFilter?
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Padding more than 1 shape within same sketch

Post by TheMarkster »

drmacro wrote: Sun Jan 02, 2022 1:25 pm
TheMarkster wrote: Thu Dec 30, 2021 11:54 pm Consider this sketch:

Snip macro screenshot-39dd1a.png

and how I padded it with 2 pads:

Snip macro screenshot-272231.png
Why didn't you use WireFilter?
It wasn't necessary and would have distracted from the point that it's already possible to pad more than one shape in the same sketch.
drmacro
Veteran
Posts: 8870
Joined: Sun Mar 02, 2014 4:35 pm

Re: Padding more than 1 shape within same sketch

Post by drmacro »

TheMarkster wrote: Sun Jan 02, 2022 4:50 pm
drmacro wrote: Sun Jan 02, 2022 1:25 pm
TheMarkster wrote: Thu Dec 30, 2021 11:54 pm Consider this sketch:

Snip macro screenshot-39dd1a.png

and how I padded it with 2 pads:

Snip macro screenshot-272231.png
Why didn't you use WireFilter?
It wasn't necessary and would have distracted from the point that it's already possible to pad more than one shape in the same sketch.
Yes, but it also does not indicate clearly how you reference the wire objects to do so... 8-)
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Padding more than 1 shape within same sketch

Post by TheMarkster »

drmacro wrote: Sun Jan 02, 2022 5:42 pm
Yes, but it also does not indicate clearly how you reference the wire objects to do so... 8-)
If anyone has any questions I'd be happy to go into more detail.
drmacro
Veteran
Posts: 8870
Joined: Sun Mar 02, 2014 4:35 pm

Re: Padding more than 1 shape within same sketch

Post by drmacro »

TheMarkster wrote: Sun Jan 02, 2022 5:59 pm
drmacro wrote: Sun Jan 02, 2022 5:42 pm
Yes, but it also does not indicate clearly how you reference the wire objects to do so... 8-)
If anyone has any questions I'd be happy to go into more detail.
Please do, when I debug into the sketch I see no wires only edges.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
chrisb
Veteran
Posts: 53935
Joined: Tue Mar 17, 2015 9:14 am

Re: Padding more than 1 shape within same sketch

Post by chrisb »

drmacro wrote: Sun Jan 02, 2022 6:00 pm Please do,
Yes please, there is something to learn.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Padding more than 1 shape within same sketch

Post by TheMarkster »

In FreeCAD a wire is a collection edges connected together end to end to form a single entity, or it can also be just a single edge. For example, a sketch containing only a rectangle has 4 edges and 1 wire. But if we delete the coincidence constraints and separate the edges, now we have 4 edges and 4 wires. These are now open wires, but still wires. We can refer to edges by name, such as Edge1 or Edge2. We can also refer to wires the same way, e.g. Wire5. While edges are selectable in the 3D view, wires are not. We can select the edges that make up the wire, but not the wire itself.

With Pads and Pockets we have the Profile property. This is of type App::PropertyLinkSub. This property type allows for 1 single object and a list of its subobjects / subshapes, such as Vertex3, Edge5, Face2, or Wire1. The property editor for this type of property is shown here:
Snip macro screenshot-ae23d0.png
Snip macro screenshot-ae23d0.png (68.4 KiB) Viewed 1997 times
This dialog is accessible by clicking the [...] button, similar to the way we bring up the Attachment editor with the MapMode property. Once the dialog is open click the object to use as the LinkSub object and then click to the column to the right to enable typing to the subobject field. There you can type in the subobjects. In the above I have typed in the Wire name, in this case Wire2. When using faces, edges, or vertices with properties of this type, we may also select the subobjects directly in the 3D view with the dialog open. But this does not work with wires; we must type them in.

This sketch has 2 wires. Here, the WireFilter macro is used to show the wires with a color coding scheme. The order of the colors for Wire1, Wire2, Wire3, etc. is Red, Green, Blue, respectively, then follows Cyan, Magenta, Yellow, and Orange for the next few.

We must open the LinkSub editor while the task is still open when making a Pad or Pocket if selecting the entire profile object would result in a failure, which would happen in this case because the wires are crossed. To do this we simply leave the dialog open and switch to the model tab where we can find the Pad object is already created. (Canceling the dialog does not prevent creation of the Pad, it causes the Pad that has already been created to be deleted.) We can edit the Profile property while the task dialog is still open because luckily the property editor is not itself a task dialog. So, the steps are to select the sketch and make the pad, while the dialog is open switch to the model tab and edit the Profile property, then switch back to the task dialog and press Ok.

The advantage to this method is we only need the 1 sketch. The disadvantage can come when someone else attempts to understand what we have done in order to maintain the model. We might even confuse ourselves when we open the model months later. The analogy in writing code is, yes, you might have some slick one-liner to perform some task, but if the slick one-liner is more difficult to read than a more traditional construction of, say, 3 lines of code, then it might actually be counter-productive to write such code.
Attachments
Snip macro screenshot-99d414.png
Snip macro screenshot-99d414.png (34.33 KiB) Viewed 1997 times
drmacro
Veteran
Posts: 8870
Joined: Sun Mar 02, 2014 4:35 pm

Re: Padding more than 1 shape within same sketch

Post by drmacro »

Hmm...I could see that you were referencing the wire. How you got to it eluded me.

That said, I found no indication that there was a wire/s in the sketch.

With the sketch open and all geometry selected, I ran a Python script that got the selection object and stopped at a breakpoint.

Here I climbed all over the sub elements, etc. and found no wire. So, the wire/s don't exist when the sketch is open?

The data structure is just convoluted, like a big balloon that people just keep patching with bubblegum. :mrgreen:

And Dorothy says: "Wires, edges, and shapes oh my" :D

And, thanks for the explanation!!
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Post Reply