feature req: Part WB - aditionally reference cube and cylinder at their midpoints

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!
herrdeh
Posts: 437
Joined: Wed Sep 03, 2014 12:15 pm

feature req: Part WB - aditionally reference cube and cylinder at their midpoints

Post by herrdeh »

Hello everybody,

(I already posted this message to "developers' corner - which was not the right place. Sorry for that)

I can hardly believe that this has not already been discussed in depth, but I could not find it.
So please apologize if I'm warming up really old stuff.

In my daily work, more than half of my parts are somehow symmetric. And cubes and cylinders are always involved.
I'm easily creating them in the Part work bench. When it now comes to resizing the parts, cubes or cylinders move out of their position, as they are referenced at a corner (cube) or the bottom (cylinder). In many circumstances this makes sense - but in the context of symmetric parts, it does not, because I always have to do two steps: resize AND reposition.

Wouldn't it be a good idea to offer the user a choice - reference your cube or cylinder
* either as it is now, or
* in addition - at the midpoint of the part ?

Ball and torus already have midpoint as reference - so hopefully it's not so complicated to use code from these to cube and cylinder.

Looking forward to your comments.
Wolf
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: feature req: Part WB - aditionally reference cube and cylinder at their midpoints

Post by DeepSOIC »

Hi!
You can achieve what you want by binding expressions to Cube.Placement. If that's too tedious, you can create a macro.

It becomes a little bit more important when dealing with attachment (in v0.17). But you can still do the same using expressions, now to superPlacement.
herrdeh
Posts: 437
Joined: Wed Sep 03, 2014 12:15 pm

Re: feature req: Part WB - aditionally reference cube and cylinder at their midpoints

Post by herrdeh »

Hi, thanks for your reply.

Sorry that I cannot understand what you are writing. I'm not into python and coding - just a user who had an idea which may make life a little easier...

Cheers,
Wolf
chrisb
Veteran
Posts: 54309
Joined: Tue Mar 17, 2015 9:14 am

Re: feature req: Part WB - aditionally reference cube and cylinder at their midpoints

Post by chrisb »

Expressions are not only for python programmers, although programming skills are helpful. Almost everywhere when you have an edit field for entering a distance you can use an expression instead: https://www.freecadweb.org/wiki/Expressions. It is the blue f(x) symbol. Sidenote: Expressions are extremely helpful to make a model robust against topological naming issues.
I will attach a file later.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54309
Joined: Tue Mar 17, 2015 9:14 am

Re: feature req: Part WB - aditionally reference cube and cylinder at their midpoints

Post by chrisb »

Here is a file, that contains a cube and a cylinder. The cube is using expressions for X and Y placement to be centered at the center of the cylinder. When you move the cylinder in X or Y direction the cube stays centered.
Watchout: If you want to see or change the expressions don't use the placement dialog! Use the data tab instead.
Attachments
exprDemoCubeCenter.FCStd
(3.65 KiB) Downloaded 29 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
herrdeh
Posts: 437
Joined: Wed Sep 03, 2014 12:15 pm

Re: feature req: Part WB - aditionally reference cube and cylinder at their midpoints

Post by herrdeh »

Thank you for your hint, good to know about the "expressions" feature anyway.
But I think, it does not have to do so much with my request, my major concern is items changing their position when resized.

W
chrisb
Veteran
Posts: 54309
Joined: Tue Mar 17, 2015 9:14 am

Re: feature req: Part WB - aditionally reference cube and cylinder at their midpoints

Post by chrisb »

herrdeh wrote:Thank you for your hint, good to know about the "expressions" feature anyway.
But I think, it does not have to do so much with my request, my major concern is items changing their position when resized.
They don't, if you fix the midpoint by means of expressions to a certain point in 3D space. Please have a look at the example I gave above and change the length of the cube: The middle stays in the middle of the cylinder.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
pablogil
Posts: 882
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: feature req: Part WB - aditionally reference cube and cylinder at their midpoints

Post by pablogil »

It's not the first time it is discussed.
I totally agree with you, mostly all part primitives are created with its centre in the origin. It doesn't happens with the cube and it could be tedious to after its creation to place it back where you wanted to be placed (as it has been said with the help of expressions).

IMHO the cube primite should be revised in order to change this behaviour or to add a new "origin parameter", I guess it is not very difficult for any skilled coder to change or add this new parameter...
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
Joyas
Posts: 532
Joined: Sat Jul 12, 2014 8:39 pm

Re: feature req: Part WB - aditionally reference cube and cylinder at their midpoints

Post by Joyas »

I agree with you, a option called "reference point, corner, midpoint" could be very useful.
Estudié ingeniería técnica industrial en España y sólo me ha servido para estar en el paro, no me contratan porque no tengo experiencia, y no tengo experiencia porque no me contratan. No debí estudiar esa carrera.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: feature req: Part WB - aditionally reference cube and cylinder at their midpoints

Post by sgrogan »

Do we have a volunteer to make a high quality feature request on the tracker and reference the issue here so it doesn't get lost?
"fight the good fight"
Post Reply