How to create a simple flared cube from 4 sketches

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!
dapab
Posts: 10
Joined: Sat Nov 21, 2020 9:26 pm

How to create a simple flared cube from 4 sketches

Post by dapab »

How do I create an open cube (top and bottom faces) with the top side construction square with longer sides than the bottom construction square (so it is a flared cube).
I'm new to freecad and finding this very tricky. I have considered using the wedge primitive shape tool but doesn't seem to offer all the control I want via easy to apply constraints or remove the top and bottom faces.
Have considered carbon copy and/or trying to apply a new sketch to a datum place at 90 degrees to the last but not much progress.
Ideally I'd like length of the sides of one sketch to constrain the other sketches.
Can anyone please advise the best way forward.
Thanks!
Attachments
planter.FCStd
(9.98 KiB) Downloaded 43 times
chrisb
Veteran
Posts: 54197
Joined: Tue Mar 17, 2015 9:14 am

Re: How to create a simple flared cube from 4 sketches

Post by chrisb »

Hi and welcome to the forum!

Can you link an image or upload a handmade doodle so we can see what you mean with top and bottom?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
dapab
Posts: 10
Joined: Sat Nov 21, 2020 9:26 pm

Re: How to create a simple flared cube from 4 sketches

Post by dapab »

Thanks for the reply
I uploaded a sketch. The top and bottom faces are open
Forgot to say I'm using v0.18 but I don't imagine that makes much difference!
Thanks
Attachments
sketch.jpg
sketch.jpg (22.65 KiB) Viewed 1250 times
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: How to create a simple flared cube from 4 sketches

Post by jmaustpc »

You replied while I was typing but you should be able to adjust my file to your values...
dapab wrote: Sat Nov 21, 2020 9:47 pm Can anyone please advise the best way forward.
there are many choices, it also depends on what data you are bsing you design. E.g. are you defining the angle of the sloping sides via an angle measurement or just by the lineal dimensions of the top, bottom, vertical height and wall thickness? If you are modelling an existing object then measuring those dimensions would be easiest. If so you could model it like this, this is also the easiest way from just a modelling point of view.
planter_demo1_top_bottom_loft.FCStd
(72.93 KiB) Downloaded 36 times
here is a screen shot
Screenshot_20201122_100717.png
Screenshot_20201122_100717.png (5.77 KiB) Viewed 1247 times
All I have done here is
1) simple sketch to define the outer dimensions of the base
2) the same but for the top
3) both sketches are attached to the XY axis plane of the Body when first created, so once created you then need to adjust the vertical offset of the top sketch by the amount of the intended vertical height of the pot (not the angled edge length which would be slightly longer). So in my example attached, look at sketch001, look at its attachment property, expand it, you will see Attachment...Position...z has been changed to 480mm which is the height of the pot (just change that value to what ever you want)
4) Select the first sketch, then PartDesign additive Loft then add the second sketch in the dialogue that pops up. You will now have a solid that you need to hollow out.
5) select just the top face of that solid (which the thickness tool will remove) then click on PartDesign "thickness" tool, add the value of the desired wall thickness, by default it is 1mm and makes the wall thickness go outwards, I guessed 10mm and toggled "reversed ...true" so that the wall thickness goes into the centre of the sketches rather than the default outwards
6) then I created another sketch on the xy axis plane, put three circles in it, one with centre coincident with origin, the other two with centres using "point on object" constraint to the horizontal axis. Then applied a radius to the centre hole, and an "equals" constraint between all three circles. Lastly I positioned the two outer circles with a Horizontal distance constraint, the value of which I defined via an expression that calculated one quarter of the total length of the base of your pot as read from the constraint in the very first sketch named "sketch". For convenience I anmed that constraint in that first sketch (gave it an alis) "base_length". If you use an alis in many places in FreeCAD, do not use spaces in the names as an Expression will not be able to read a name with a space.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: How to create a simple flared cube from 4 sketches

Post by jmaustpc »

dapab wrote: Sat Nov 21, 2020 11:23 pm Forgot to say I'm using v0.18 but I don't imagine that makes much difference!
Only well over 6 thousand bug fix and new feature code commits! :)

Forget 0.18 just move to the latest snapshot of 0.19, you will not regret it.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: How to create a simple flared cube from 4 sketches

Post by jmaustpc »

dapab wrote: Sat Nov 21, 2020 11:23 pm Thanks for the reply
I uploaded a sketch.
Top is 1000 x 1000
bottom is 800 x 800
it looks like the vertical is not defined, or is it? Is that 450mm the vertical height or is it the length of that slopped edge which would be clightly longer than the vertical height since it is angled?

also what is the wall thickness of the material and is the base (if it exists) the same thickness as the sides?

dapab wrote: Sat Nov 21, 2020 11:23 pm The top and bottom faces are open
You keep saying that but surely that can not be true, if it's a planter box it must have a bottom. If not modelling it is even easier, just put one rectangle inside another in each sketch, the result of the Loft will be like a tube as the inner rectangle will define the inner wall and the outer rectangle will define the outer wall.


OS: Ubuntu 18.04.5 LTS (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.daily PPA
Build type: Release
Branch: unknown
Hash: 20649ec5292a31279f5593eccee2c5cd106bb099
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Australia (en_AU)
dapab
Posts: 10
Joined: Sat Nov 21, 2020 9:26 pm

Re: How to create a simple flared cube from 4 sketches

Post by dapab »

Wow thanks so much! I can't tell you how many hours I've spent watching video tutorials etc...
I'm pretty excited by this since I now realise that I can use an expression to set the z coordinate of the top sketch (your step 3)
Predictably I've hit an issue setting the expression....

I think it should be (I renamed the sketches for clarity):
sqrt(480^2 - (((Sketch_top.Constraints.top_length-Sketch_bottom.Constraints.base_length)/2)^2 )) but the parser doesn't like that.

I tried building the expression bit by bit:
Sketch_top.Constraints.top_length - Sketch_bottom.Constraints.base_length / 2 gives parser result of 100 mm (as expected)
but e.g. srqt (Sketch_top.Constraints.top_length - Sketch_bottom.Constraints.base_length / 2) gives result 'all dimensions must be even to calculate the square root'

sketch2.jpg
sketch2.jpg (23 KiB) Viewed 1165 times

Also I'd like to have these three parameters in an easy to set place for modelling - is spreadsheet the best place?
Thanks again
chrisb
Veteran
Posts: 54197
Joined: Tue Mar 17, 2015 9:14 am

Re: How to create a simple flared cube from 4 sketches

Post by chrisb »

You can always use a spreadsheet to calculate things in several steps. If it is a units thing - and the square root of mm cannot be drawn - then you can multiply or divide by "1mm" to add or remove such units.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
papyblaise
Veteran
Posts: 8000
Joined: Thu Jun 13, 2019 4:28 pm
Location: France

Re: How to create a simple flared cube from 4 sketches

Post by papyblaise »

a few trigo
you fin x^2= (450^2-(a-b)^2) picture#1
I draw a pyramid 1000x800x450 , I cut a long is diagonal , on this face i mesur is diagonal , and obtain the equation above x=427.25

I draw the final pyramid and verify the corner picture#2 (my error is 0.05mm :!: )
Attachments
tremie#2.PNG
tremie#2.PNG (11.09 KiB) Viewed 1124 times
tremie#1.PNG
tremie#1.PNG (25.48 KiB) Viewed 1124 times
tremie.PNG
tremie.PNG (18.55 KiB) Viewed 1124 times
tremie.FCStd
(97.56 KiB) Downloaded 23 times
dapab
Posts: 10
Joined: Sat Nov 21, 2020 9:26 pm

Re: How to create a simple flared cube from 4 sketches

Post by dapab »

Thanks everyone
I'm posting my semi final project file as reference to anyone else who might find it useful. The base of the planter is optional!
The parameters are set in a spreadsheet and dynamically update the shape which is fantastic functionality!
Attachments
planter model1.FCStd
(132.94 KiB) Downloaded 24 times
Post Reply