feature req: placement - rotate part around its midpoint
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
feature req: placement - rotate part around its midpoint
When I put my parts into their position, often they have to be rotated by a certain degree. But when I'm using placement, it will by default rotate around the origin of the whole project. When the project is a little bigger, this is not a good thing as the part will completely be moved out of its position.
To make life easier (that, what we're using CAD, true?), I'd like two features:
* a context menu entry (RMB) "copy coordinates of mouse pointer to clipboard" - which can be pasted to the placement dialogue in the next step, and
* a "rotate selected item around its midpoint" button in the placement dialogue, which will automatically calculate the midpoint and insert it into the placement dialogue. This button can be deactivated in cases where the midpoint calculation is too complicated, but there is no problem with cylinders, cubes, balls etc.
Cheers,
Wolf
To make life easier (that, what we're using CAD, true?), I'd like two features:
* a context menu entry (RMB) "copy coordinates of mouse pointer to clipboard" - which can be pasted to the placement dialogue in the next step, and
* a "rotate selected item around its midpoint" button in the placement dialogue, which will automatically calculate the midpoint and insert it into the placement dialogue. This button can be deactivated in cases where the midpoint calculation is too complicated, but there is no problem with cylinders, cubes, balls etc.
Cheers,
Wolf
Re: reature req: placement - rotate part around its midpont
If the part is not symmetric, do you want the center of mass as midpoint? (And do you mind correcting the typo in the title? It makes it easier to find).
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: feature req: placement - rotate part around its midpoint
Of course, this is a good idea. But I suppose, this needs more code lines than just finding the midpoint, and is less helpful at the same time.If the part is not symmetric, do you want the center of mass as midpoint?
Therefore, this feature could go to prio #2 for my taste,
Re: feature req: placement - rotate part around its midpoint
Which midpoint do you mean then, that is easy to find? I have seen, that there is a CenterOfMass function, although I couldn't get it working due to some type error.herrdeh wrote:Of course, this is a good idea. But I suppose, this needs more code lines than just finding the midpoint, and is less helpful at the same time.If the part is not symmetric, do you want the center of mass as midpoint?
Therefore, this feature could go to prio #2 for my taste,
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: feature req: placement - rotate part around its midpoint
I think, at this point "finding the midpoint of an irregular object", it's a bit of guessing what the particular user means in that situation. Therefore, it might not be worth to but too much effort into it..
The mass midpoint is a good idea, another approach could be to take the mass midpoints of the 3 projected surfaces in x-, y- and z-direction. Meaning: create a plane of constant thickness of each projection and take that mass midpoint.
But I think, the user will not expect the machine to guess his thoughts...
Thanks for refelcting on this issue!
W
The mass midpoint is a good idea, another approach could be to take the mass midpoints of the 3 projected surfaces in x-, y- and z-direction. Meaning: create a plane of constant thickness of each projection and take that mass midpoint.
But I think, the user will not expect the machine to guess his thoughts...
Thanks for refelcting on this issue!
W
Re: feature req: placement - rotate part around its midpoint
What you suggest seems to be sensible as well and I think it is not too hard to accomplish: In each dimension X, Y, Z it is the midpoint of the enclosing rectangle, but of course it is more to do than nothing.
I am afraid there is some effort necessary anyway, albeit to decide if a solid has a regular shape or not.
I am afraid there is some effort necessary anyway, albeit to decide if a solid has a regular shape or not.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: feature req: placement - rotate part around its midpoint
it is possible to use centerofmass or bounding boxchrisb wrote: Which midpoint do you mean then, that is easy to find? I have seen, that there is a CenterOfMass function, although I couldn't get it working due to some type error.
I use both on my macro for aligning parts
Macro_Center_Align_Objects_with_Faces_or_Edges on Macro recipes
Re: feature req: placement - rotate part around its midpoint
Thanks for sharing the code. It was now easy to find my error: I had called the non existent function CenterOfMass() and didn't use the attribute.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: feature req: placement - rotate part around its midpoint
hi
not totally finished
mario
not totally finished
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.
Re: feature req: placement - rotate part around its midpoint
Hi Mario, very nice!mario52 wrote:hi
not totally finished
Macro_Rotate_To_Point00.gif
mario
Would it nice/possible to add also rotate on Edge?
Maurice