Clone of sketch for Part Design

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!
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Clone of sketch for Part Design

Post by ulrich1a »

Is there any reason, why a clone of a sketch can not be used to start a Part-Design-shape?

The use of a clone of a sketch could be useful in a lot of cases, where two parts have to be modeled with some comon dimensions. A typical example is a box with a separate cover.

Ulrich
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Clone of sketch for Part Design

Post by shoogen »

ulrich1a wrote:Is there any reason, why a clone of a sketch can not be used to start a Part-Design-shape?
A clone object only copies the shape of an object. All other properties and type information are lost. The result of a clone is a Part::FeaturePython object and not a Sketch.
I think we should implement another way to allow reusing a sketch.
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Clone of sketch for Part Design

Post by wmayer »

And what about using the command "Duplicate selection" from the Edit menu?
User avatar
rockn
Veteran
Posts: 1791
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: Clone of sketch for Part Design

Post by rockn »

Because Clone make a copy that is parametrically bound to the original object. If the original change the Clone change too.
Duplicate just make a copy but there isn't link with the original object.
Formations - Assistance - Développement : https://freecad-france.com
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Clone of sketch for Part Design

Post by wmayer »

Duplicate just make a copy but there isn't link with the original object.
There is a link. Make a cube, select a face and create a sketch. To the sketch you can add a rectangle or also an external geometry. Now close the sketch, select it and use "Duplicate selection". When I edit now the copied sketch I can see all geometries, external geometries and constraints.

Then you can verify with Dependency graph that the link to the support face is really there.
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Clone of sketch for Part Design

Post by shoogen »

wmayer wrote:
Duplicate just make a copy but there isn't link with the original object.
There is a link.
But only for mapped faces and not for the actual Sketch geometry.
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Clone of sketch for Part Design

Post by wmayer »

Sorry but what do you miss then?
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Clone of sketch for Part Design

Post by ulrich1a »

wmayer wrote:Sorry but what do you miss then?
I do miss the possibility defining some dimensions at one place for a sketch and then base two different parts on this common set of dimensions.

One possibility would be the use of a cloned object. The inner definitions of cloned sketch would not be editable like a sketch. But the Part-Design-Workbench could use the wires of the clone as a starting sketch.

Alternative I am thinking about a totally different approach: Is there a possibility to disclose named constraints of a sketch as properties of this sketch in the sketch properties tab together with the placement of the sketch. This would allow to change key constraints without opening of the sketch. Then those properties could be accessed by a spreadsheet. This would allow to define some key values in a spreadsheet and different sketches with Part-Design-shapes could be based on these values.

Ulrich
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Clone of sketch for Part Design

Post by jriegel »

We could do it easily by a new Part2DObject derived feature. It links to a sketch (or and other Part2DObject) and has its own placement. It would simply follow the sketch...
Stop whining - start coding!
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Clone of sketch for Part Design

Post by yorik »

Similar to the Draft clone, but based on a Part2DObject instead... Good idea.

I'm committing a small change to the Draft Clone object. Now, if you make a clone from a Part2DObject, like a sketch or a 2d draft object, the clone is also a Part2DObject, so you can use it as a base for any operation that require such an object. The name of the clone will reflect that it is 2D.

If the linked shape of the clone is changed and is not a 2D object anymore, such 2D clone will refuse to compute a shape and issue a warning message.
Post Reply