FC v0.17dev: Part Design Next Usecases and Best practices

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
m0n5t3r
Posts: 138
Joined: Fri Feb 03, 2017 2:55 pm

Re: FC v0.17dev: Part Design Next Usecases and Best practices

Post by m0n5t3r »

Since this topic is about best practices, and I'm self taught in these matters: how frowned upon is it to, say, name a sketch "master" or something along the lines of this, name the constraints for use in formulas, and also use the sketch afterwards? I've been using spreadsheets in the past, but using named constraints seems easier (also, for complex models any change in the spreadsheet would make the whole thing recompute and slow my computer to a crawl, but that was many months ago, not sure if it's still the case).
Screenshot from 2018-02-22 10-14-35.png
Screenshot from 2018-02-22 10-14-35.png (32.97 KiB) Viewed 4824 times
full model (disregard the overcomplicated way I did the initial thing instead of using a revolution in the first place, the principle stands)
30mm_bung.fcstd
(73.23 KiB) Downloaded 82 times
Also, is there a way to, say, have multiple parametric instances of a body? e.g. an elastic motor coupler like this one has the ends identical apart from the shaft diameter (5mm and 8mm in my case)
Screenshot from 2018-02-22 10-29-46.png
Screenshot from 2018-02-22 10-29-46.png (30.2 KiB) Viewed 4824 times
The only way I managed to do this was to change the diameter in the pocket sketch and export a new .obj file, which works for printing, but doesn't (?) allow having an exploded view of the whole thing.

model (this is rather disorganized because I was still figuring this method out, i.e. not all dimensions and cross-sections are gathered in a "master" sketch):
coupler.fcstd
(275.88 KiB) Downloaded 79 times
chrisb
Veteran
Posts: 54303
Joined: Tue Mar 17, 2015 9:14 am

Re: FC v0.17dev: Part Design Next Usecases and Best practices

Post by chrisb »

m0n5t3r wrote: Thu Feb 22, 2018 8:48 am Also, is there a way to, say, have multiple parametric instances of a body? e.g. an elastic motor coupler like this one has the ends identical apart from the shaft diameter (5mm and 8mm in my case)
You have the pattern operations in Part Design. They can repeat features in a linear or polar arrangement.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
m0n5t3r
Posts: 138
Joined: Fri Feb 03, 2017 2:55 pm

Re: FC v0.17dev: Part Design Next Usecases and Best practices

Post by m0n5t3r »

chrisb wrote: Thu Feb 22, 2018 10:49 am You have the pattern operations in Part Design. They can repeat features in a linear or polar arrangement.
doesn't help in this case, as far as I can tell, because linear and polar arrays (and the other operations) duplicate the object in various ways

what I was looking for was a way to treat a body like, say, a class definition, in order to avoid duplicating effort: set some variables as public properties, then, say clone the object and be able to change those values on the clone :)
chrisb
Veteran
Posts: 54303
Joined: Tue Mar 17, 2015 9:14 am

Re: FC v0.17dev: Part Design Next Usecases and Best practices

Post by chrisb »

So you want a clone which inherits all values except those which are explicitely set? Or do you want to use Expressions?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
m0n5t3r
Posts: 138
Joined: Fri Feb 03, 2017 2:55 pm

Re: FC v0.17dev: Part Design Next Usecases and Best practices

Post by m0n5t3r »

A clone that only exposes some parameters would probably be ideal, and the closest thing you'd get to either openscad modules or the OOP paradigm (instance of a class with some public properties and the rest of the implementation hidden - I guess the terminology will be less familiar to non-programmers, but the concept should be easy to grasp, what with building objects and all).

I don't know how clones work under the hood; if it's "create simple copy" with a trigger to recompute when something changes in the source object, it will be difficult to add the parameter thingy.

I already use expressions heavily in the models I posted above, that's why I asked if it's a good idea to use a sketch that's in a pad, etc. to also define values for the rest of the object: the thing in the first image is a carboy stopper with a hole for an airlock; I defined the dimensions in the first sketch with named constraints, then I padded it, etc. and used the values in the rest of the object (less than ideal, mind you, with pads and drafts and stuff, especially since draft is a bit finicky and also doesn't take expressions).

Then I wised up and used revolutions when I added a mold for casting the thing out of silicone / oogroo, and used the values defined in the first sketch for that as well, along with some that are mold-specific (the registration overlap between the lids and the body); changing something like the wall thickness in the first sketch propagated perfectly to the mold afterwards.
chrisb
Veteran
Posts: 54303
Joined: Tue Mar 17, 2015 9:14 am

Re: FC v0.17dev: Part Design Next Usecases and Best practices

Post by chrisb »

m0n5t3r wrote: Fri Feb 23, 2018 7:34 am especially since draft is a bit finicky and also doesn't take expressions
You can use expressions for draft in the data tab.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
m0n5t3r
Posts: 138
Joined: Fri Feb 03, 2017 2:55 pm

Re: FC v0.17dev: Part Design Next Usecases and Best practices

Post by m0n5t3r »

TIL. thanks, I didn't notice it, I was using the UI and that one doesn't have expression support.

... and it is a bit buggy or PEBKAC (complains about incompatible units when I try to link it to an angle constraint), but this is offtopic, my questions were about the compatibility of my workflow with generally accepted practices (which matters if you publish / share designs, or try to teach others).
chrisb
Veteran
Posts: 54303
Joined: Tue Mar 17, 2015 9:14 am

Re: FC v0.17dev: Part Design Next Usecases and Best practices

Post by chrisb »

m0n5t3r wrote: Fri Feb 23, 2018 11:33 am
TIL. thanks, I didn't notice it, I was using the UI and that one doesn't have expression support.

... and it is a bit buggy or PEBKAC (complains about incompatible units when I try to link it to an angle constraint),
Works here already in 0.16. Values have to be entered / calculated without unit.

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6712 (Git)
Build type: Release
Branch: releases/FreeCAD-0-16
Hash: da2d364457257a7a8c6fb2137cea12c45becd71a
Python version: 2.7.11
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
ppemawm
Veteran
Posts: 1240
Joined: Fri May 17, 2013 3:54 pm
Location: New York NY USA

Re: FC v0.17dev: Part Design Next Usecases and Best practices

Post by ppemawm »

NormandC wrote: Wed Nov 09, 2016 2:32 am

Basically, you need to stop mapping sketches to faces - entirely! Place your sketches on standard planes, or on custom datum planes. And when creating datum geometry, do not base it on the part topology, base it on standard planes/axes and/or sketches. I think it's also worth pursuing a "master sketch" approach, since you can now create external geometry linked to an other sketch. I assume (maybe wrongly) that sketches may not suffer as much from the topological naming issue.
...
But all this is theoretical, it needs to be put to the test. ;)
I am amazed at how powerful this new capability is. As a simple model, I tired this out on one of the PartDesign tutorials: Basic Part Design Tutorial.

Only one simple master sketch is required, and the complete object can be modeled without attaching any sketch to a face. Each feature is from a sketch with attachment offset as required and external geometry reference to the master sketch. I also discovered that a second master sketch of the frontal view can be used to define pad and pocket dimensions by use of Expressions so that all geometry is only dependent upon master sketches. This results in a much more robust model. Powerful indeed!

File is attached for reference.

Picture1.jpg
Picture1.jpg (129.94 KiB) Viewed 4263 times
Basic_Part_Design_tutorial_V0.17-mastersketch.FCStd
(95.79 KiB) Downloaded 453 times
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13509 (Git)
Build type: Release
Branch: releases/FreeCAD-0-17
Hash: 0258808ccb6ba3bd5ea9312f79cd023f1a8671b7
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)
"It is a poor workman who blames his tools..." ;)
schupin
Posts: 476
Joined: Sun Jan 21, 2018 1:43 pm

Re: FC v0.17dev: Part Design Next Usecases and Best practices

Post by schupin »

Nice and easy to understand example ppemawm,

But I feel stupid, I can't see how you made the link between your master sketch and the others ?
Your sketch001 possesses 2 points with a "red cross" that seemed to be picked from the master sketch. I don't know how you did it ?
(I only know how to pick a edge from another sketch as a reference, not a point :()
Post Reply