Table - Parametric model with datum planes

Show off your FreeCAD projects here!
User avatar
babaroga
Posts: 89
Joined: Sun Aug 14, 2016 6:52 pm
Location: Banja Luka, Republic of Srpska, Bosnia and Herzegovina

Table - Parametric model with datum planes

Postby babaroga » Thu Sep 22, 2016 10:36 am

This project is product of experimenting with datums in Part Design New WB. I didn't "fall in love" with this feature at first sight, to be honest. My first experience with datum planes was lot of crashing, this feature was not documented well. So I decide to spent some time and explore DO's and DONT's. While drawing this I didn't experience a single crash, so I will continue to use this approach as rather stable.



I will share my findings with hope it will help someone.

So it works like this:
Peek 2016-09-22 10-14.gif
Peek 2016-09-22 10-14.gif (369.06 KiB) Viewed 3977 times
First I created tabletop:
1. Create New body (I renamed it to "Tabletop")
2. Create New sketch base it on XY plane
3. Draw rectangle (see sketch "Sketch" for details)
4. I named Length and Width constrain to easier find them later
5. Make a pad

Then I tried to draw a Leg:
1. Create New body (I renamed it to "Leg1")
2. In a tree, select body "Tabletop"
3. Press Shape binder to create one, confirm with OK (don't mess with any other options)
4. In tree select body "Tabletop" and hide it. You are suppose to have only Shape binder on screen (Yellowish semitransparent "ghost" of tabletop)
5. Select bottom plane of Shape binder and press "Create new sketch"
6. Draw a sketch of the leg profile (on exit, in one of 3 cases, FreeCAD crash)
7. Create a pad of it
...and than something unexpected happens. For some reason Shape binder turn to solid and fuse with my leg :shock:
NOTE: Tabletop is already hidden
Screenshot 01.png
Screenshot 01.png (7.88 KiB) Viewed 3977 times
OK, let's try another way:
Delete created Pad
Delete Sketch. Now we start from new point 5
5. Select bottom plane of Shape binder and press "Create Datum plane", be sure to select bottom plane of "Shape binder". Just press OK to confirm it (don't mess with any other options)
6. Select "DatumPlane" and press "Create New Sketch"
7. Draw a sketch of the leg profile. This is sketch "Sketch001" in my drawing. You can use external geometry links to "ShapeBinder"
I named some constraints "Overhang" and "Leg_Width", and refer to them afterwards like shown in picture.
Screenshot 2-3.png
Screenshot 2-3.png (49.64 KiB) Viewed 3977 times
8. Pad the sketch, and we have our leg.

I was not able to find a way to mirror this pad or even body. I always get "One transformed shape does not intersect support"
OK, so lets repeat procedure for other three legs. New body -> Create Shape Binder of Tabletop -> Create DatumPlane on ShapeBinder -> create Sketch on DatumPlane -> Pad

To keep all legs same length, you can use formula in Pad parameters. I really like this possibility.
Screenshot 04.png
Screenshot 04.png (40 KiB) Viewed 3977 times
So in the end we have tabletop with three legs.

I will continue with rails in next post because of 5 pictures limit.

Something about my system:

OS: Ubuntu 16.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.8414 (Git)
Build type: Release
Branch: master
Hash: d20ea7ac906bd7bf803ac9429ac4241cac054eb8
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
Attachments
Table.fcstd
(89.52 KiB) Downloaded 129 times
Last edited by babaroga on Thu Sep 22, 2016 12:14 pm, edited 1 time in total.
User avatar
DeepSOIC
Posts: 7480
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Table - Parametric model with datum planes - no

Postby DeepSOIC » Thu Sep 22, 2016 10:46 am

Hi!
babaroga wrote:5. Select bottom plane of Shape binder and press "Create new sketch"
6. Draw a sketch of the leg profile (on exit, in one of 3 cases, FreeCAD crash)
7. Create a pad of it ...and than something unexpected happens. For some reason Shape binder turn to solid and fuse with my leg
Now that is a bug! I think I am in part responsible for it, and it is most likely legacy workflow kicking in when it shouldn't.

As for crashes on step 6, everyone would be grateful if you narrow down the step-by-step method of triggering this crash.
User avatar
babaroga
Posts: 89
Joined: Sun Aug 14, 2016 6:52 pm
Location: Banja Luka, Republic of Srpska, Bosnia and Herzegovina

Re: Table - Parametric model with datum planes - no

Postby babaroga » Thu Sep 22, 2016 11:20 am

DeepSOIC wrote:As for crashes on step 6, everyone would be grateful if you narrow down the step-by-step method of triggering this crash.
:oops: Sorry I tried to reproduce this crash but nothing happened. I guess it was fixed in some of the latest commits. But anyway, it happened when trying to base sketch from one body to surface or even datum plane in another body.
I built FreeCAD from git about hour ago, and I was not able to crash it this way.
User avatar
babaroga
Posts: 89
Joined: Sun Aug 14, 2016 6:52 pm
Location: Banja Luka, Republic of Srpska, Bosnia and Herzegovina

Re: Table - Parametric model with datum planes - no

Postby babaroga » Thu Sep 22, 2016 12:11 pm

And now second part. Rails!

We have tabletop with four legs.
Screenshot 5.png
Screenshot 5.png (31.38 KiB) Viewed 3947 times
In sketches for Leg2, Leg3 and Leg4 I referenced constraints "Leg_Width" and "Overhang" from "Sketch001" belonging to "Leg1".

And now thing that I didn't believe it will work at all, but it works like charm.

So rails...
1. Create new body and rename it to "Rail1"
2. Create Shape binder of "Tabletop" , "Leg1" and "Leg2"
3. Hide bodies "Tabletop" , "Leg1" and "Leg2"
4. Create Datum Plane on bottom of "Tabletop" Shape Binder, and you will get something like this:
Screenshot 06.png
Screenshot 06.png (68.28 KiB) Viewed 3947 times
5. Now you can hide "Tabletop" Shape Binder (in this case ShapeBinder006)
6. Select Datum plane you just created (in this case DatumPlane006) and create sketch on it
7. And now thing I was amazed it is possible :o , you can select external geometry, in this case edge of Leg1 and Leg2 Shapebinder. Look at "Sketch005" in body "Rail1".
Screenshot 7-8.png
Screenshot 7-8.png (111.55 KiB) Viewed 3947 times
8. Pad it, and hide Shape binders and Datum plane
Screenshot 9.png
Screenshot 9.png (57.81 KiB) Viewed 3947 times
Repeat this operation for other three rails. I referenced dimensions from "Rail1" to other three rails. That is Sketch005.Constraints.Rail_thickness and Pad005.Length.

Our table is finished. We can adjust parameters of table by adjusting some values in property view:

Dimensions of the tabletop
Tabletop->Sketch ----> Data->Constraints->Width and Height (Height !? :shock: - I gave it stupid name)

Dimension of leg
Leg1->Sketch001 ----> Data->Constraints->Leg_width

Overhang of tabletop over legs
Leg1->Sketch001 ----> Data->Constraints->Overhang

Leg length
Leg1->Pad001 ----> Data->Pad->Length

Rail Thickness
Rail1->Sketch005 ----> Data->Constraints->Rail_thickness

Rail Hight
Rail1->Pad005 ----> Data->Pad->Length
User avatar
DeepSOIC
Posts: 7480
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Table - Parametric model with datum planes

Postby DeepSOIC » Thu Sep 22, 2016 12:43 pm

Great.
A few recommendations.
1. It isn't necessary to map sketches to faces to make external geometry links. A baseplane XY will do for every sketch of your model. And I highly recommend choosing a stable attachment for a sketch to minimize chances of model breakage.
2. You can make shapebinders for sketches instead of solids. This again gives you more stable geometry referencing, and reduces chances of breaking the model.
User avatar
babaroga
Posts: 89
Joined: Sun Aug 14, 2016 6:52 pm
Location: Banja Luka, Republic of Srpska, Bosnia and Herzegovina

Re: Table - Parametric model with datum planes

Postby babaroga » Thu Sep 22, 2016 12:59 pm

Thanks!

I will try that. Referencing of external geometry between different bodies was something that I still have to discover.
cox
Posts: 963
Joined: Wed Nov 26, 2014 11:37 pm

Re: Table - Parametric model with datum planes

Postby cox » Thu Sep 22, 2016 6:22 pm

Nice posts, babaroga :D

I took the liberty to link to this from Part Design Next Usecases and Best practices. Hope this is ok.
Need help? Feel free to ask, but please read the guidelines first
User avatar
babaroga
Posts: 89
Joined: Sun Aug 14, 2016 6:52 pm
Location: Banja Luka, Republic of Srpska, Bosnia and Herzegovina

Re: Table - Parametric model with datum planes

Postby babaroga » Thu Sep 22, 2016 6:48 pm

Yes, it is ok, of course. That is this forum for. ;)

I have few more to share when I catch some spare time.