an other Alignment Tool for Placing Parts

Need help, or want to share a macro? Post here!
User avatar
easyw-fc
Posts: 2580
Joined: Thu Jul 09, 2015 9:34 am

an other Alignment Tool for Placing Parts

Postby easyw-fc » Mon Jan 09, 2017 3:45 pm

Hi,
'cause recently I've found some user asking for help in aligning part in FC without using assembly2,
I've uploaded a video to help in using my alignment tool...

Macro_Center_Align_Objects_with_Faces_or_Edges on Macro recipes

Image

(still there is some work to do on aligning linear edges...)

hoping that could be of some help :)

Maurice
triplus
Posts: 8422
Joined: Mon Dec 12, 2011 4:45 pm

Re: an other Alignment Tool for Placing Parts

Postby triplus » Mon Jan 09, 2017 4:33 pm

I watched the video and such tools are indeed highly usable.

Thanks.
User avatar
easyw-fc
Posts: 2580
Joined: Thu Jul 09, 2015 9:34 am

Re: an other Alignment Tool for Placing Parts

Postby easyw-fc » Mon Jan 09, 2017 7:23 pm

triplus wrote:I watched the video and such tools are indeed highly usable.
Thanks.
thanks @triplus :D
User avatar
r-frank
Posts: 2181
Joined: Thu Jan 24, 2013 6:26 pm
Location: Möckmühl, Germany
Contact:

Re: an other Alignment Tool for Placing Parts

Postby r-frank » Tue Jan 10, 2017 7:20 am

Nice work Maurice, thanks for sharing ...
easyw-fc wrote:(still there is some work to do on aligning linear edges...)
Do you know this macro from Javier Martinez ?
Deutsche FreeCAD Tutorials auf Youtube
My GrabCAD FreeCAD-Projects
FreeCAD lessons for beginners in english

Native german speaker - so apologies for my english, no offense intended :)
HoWil
Posts: 831
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: an other Alignment Tool for Placing Parts

Postby HoWil » Tue Jan 10, 2017 8:55 am

easyw-fc wrote: hoping that could be of some help :)
Maurice
Thanks easyw-fc for sharing this.
Are the parts 'only' moved or is the relation between the faces/edges also stored somewhere like in assembly2?

Is your tool reusing code from assembly2? Is it maybe more performant or do you see some other benefits beside being simpler to handle than assembly2?

BR,
HoWil
User avatar
easyw-fc
Posts: 2580
Joined: Thu Jul 09, 2015 9:34 am

Re: an other Alignment Tool for Placing Parts

Postby easyw-fc » Tue Jan 10, 2017 9:30 am

r-frank wrote:Do you know this macro from Javier Martinez ?
thx I'll have a look :)
Maurice
User avatar
easyw-fc
Posts: 2580
Joined: Thu Jul 09, 2015 9:34 am

Re: an other Alignment Tool for Placing Parts

Postby easyw-fc » Tue Jan 10, 2017 9:47 am

Hi @HoWil
HoWil wrote: Are the parts 'only' moved or is the relation between the faces/edges also stored somewhere like in assembly2?
the macro is only moving parts, without adding any fixed constrains
HoWil wrote:Is your tool reusing code from assembly2?
the button Move is using assembly2 code...
Aligning functions are derived in part from Macro Work Feature
HoWil wrote:Is it maybe more performant or do you see some other benefits beside being simpler to handle than assembly2?
I developed this macro because assembly2 was missing a tool to align faces and to align axis for faces...
after having developed this macro I added these features also to assembly2
https://github.com/hamish2014/FreeCAD_a ... 2/pull/125
https://github.com/hamish2014/FreeCAD_a ... 2/pull/127
(and before I made assembly2 compatible with FC 0.17 Body thing
https://github.com/hamish2014/FreeCAD_a ... ba8011bc45
https://github.com/hamish2014/FreeCAD_a ... /README.md
'Thanks to Maurice (easyw-fc) assembly2 will work with files from FreeCAD 0.17.')

Moreover I use this Macro in cases when:
1) I don't need to have fixed constrains
2) I need to align parts maintaining a fixed position in the document for i.e. a single part
3) I need to align parts that are not aligned/constrained correctly by assembly2
here a thread about the difficulty to align parts in some situation (in italian)
viewtopic.php?f=28&t=19441&start=10#p150692
EDIT
4) an other thing is that with this tools the parts are just moved around and don't depend on assembly2 compatibility of solver in different releases of FC

Probably assembly2 would need some improvements in the solver, buth I think it would be a quite complex task...

Maurice
Last edited by easyw-fc on Tue Jan 10, 2017 1:07 pm, edited 1 time in total.
cox
Posts: 963
Joined: Wed Nov 26, 2014 11:37 pm

Re: an other Alignment Tool for Placing Parts

Postby cox » Tue Jan 10, 2017 10:59 am

Like it a lot, Maurice :D

I would like to suggest one new feature regarding the flip normal selection.

How about as default behaviour, to choose the closest orientation(not rotate more than 180deg in any direction) and only use flip normal if this does not produce the wanted result.

EDIT: My thinking is that it would be easier to choose the correct setting up front, before executing the align command.
Need help? Feel free to ask, but please read the guidelines first
User avatar
easyw-fc
Posts: 2580
Joined: Thu Jul 09, 2015 9:34 am

Re: an other Alignment Tool for Placing Parts

Postby easyw-fc » Tue Jan 10, 2017 11:49 am

cox wrote:Like it a lot, Maurice :D
thx :D
cox wrote: How about as default behaviour, to choose the closest orientation(not rotate more than 180deg in any direction) and only use flip normal if this does not produce the wanted result.
EDIT: My thinking is that it would be easier to choose the correct setting up front, before executing the align command.
flip normal is useful to joint / mate faces, instead of align them
align-faces.png
align-faces.png (189.39 KiB) Viewed 2171 times
align-faces-inverted-normal.png
align-faces-inverted-normal.png (206.22 KiB) Viewed 2171 times
the best would be as in Catia Snap tool, with a visual feed back... but for me it is a bit too complex task for a quite small benefit ...
catia-snap-tool.png
catia-snap-tool.png (513.36 KiB) Viewed 2171 times
Catia V5|Assembly Design|Move|Snap Tool

but I must confess that I envy a bit that interface :D
mario52
Posts: 2602
Joined: Wed May 16, 2012 2:13 pm

Re: an other Alignment Tool for Placing Parts

Postby mario52 » Tue Jan 10, 2017 5:05 pm

hi easyw-fc
but I must confess that I envy a bit that interface
try Macro_FCSpring_Helix_Variable (new version)

and see this section
Image

principe:
1: create axis to center > center circles
2: discretize the axis (my macro 0.1 mm)
3: use the coordinates created
4: and displace the object along the axis

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Dialog creation. My macros on Gist.github.