A2Plus part placement

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Buddy Hy
Posts: 32
Joined: Sat Aug 31, 2019 11:30 am

A2Plus part placement

Post by Buddy Hy »

Hi All,

How do I move parts in A2Plus so that they line up exactly where they need to be so I can start constraining their movements?
Attachments
test.FCStd
(11 KiB) Downloaded 46 times
un1corn
Posts: 240
Joined: Sat Dec 26, 2015 2:06 pm

Re: A2Plus part placement

Post by un1corn »

Is this what you are trying to do?
The constraint icons shown in the tree should help.
Click back of shaft, CTRL then front of disk, click on the constraint illuminated on bar, same with pin/pegs click on diameter CTRL plus hole diameter then select illuminated constraint icon.
Attachments
Test XX.JPG
Test XX.JPG (147.67 KiB) Viewed 2610 times
Buddy Hy
Posts: 32
Joined: Sat Aug 31, 2019 11:30 am

Re: A2Plus part placement

Post by Buddy Hy »

Hi Un1corn,

That would have been my next question if I couldn't figure it out.
It is kind of in the positions I want, but I can't get them where I want. That was my original question.

How did you move them into their correct places?
kisolre
Veteran
Posts: 4163
Joined: Wed Nov 21, 2018 1:13 pm

Re: A2Plus part placement

Post by kisolre »

Buddy Hy wrote: Tue Sep 17, 2019 10:47 pm How did you move them into their correct places?
You dont move them. The assembly solver moves them. You create a constraint that says "this circle should be coplanar to this plane", "this circles should be concentric to this circle",... and the solver moves things around until all constraints are fulfilled.
chrisb
Veteran
Posts: 53928
Joined: Tue Mar 17, 2015 9:14 am

Re: A2Plus part placement

Post by chrisb »

Moved to Assembly subforum.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Buddy Hy
Posts: 32
Joined: Sat Aug 31, 2019 11:30 am

Re: A2Plus part placement

Post by Buddy Hy »

Well, I was able to move all the parts to their correct position, thanks to Kisolre.
But now I don't know how to make them move in unison to test if the parts work together (I know they do - but remember, this is a test).
Do I use A2Plus or Animation to do this?
Attachments
test.FCStd
(13.15 KiB) Downloaded 45 times
chrisb
Veteran
Posts: 53928
Joined: Tue Mar 17, 2015 9:14 am

Re: A2Plus part placement

Post by chrisb »

Sounds rather like a call for animation workbench. I don't know how that workbench interacts with assemblies, but it is worth a try. Please note that there is no collision detection.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: A2Plus part placement

Post by Syres »

While A2P is not designed to be an assembly animation workbench, using some Python it can produce (slow but stable) animations using the solver as per Klaus' example https://forum.freecadweb.org/viewtopic. ... 30#p290004

I've just tested it successfully using V0.4.26b of the Wb with :

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18234 (Git)
Build type: Release
Branch: master
Hash: 3af5d97e9b2a60823815f662aba25422c4bc45bb
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
Buddy Hy
Posts: 32
Joined: Sat Aug 31, 2019 11:30 am

Re: A2Plus part placement

Post by Buddy Hy »

Hi Syres, I've downloaded Klaus' example but can't highlight the constraints to see how they work - so I can only guess where the circularEdge and pointOnPlane constraints are. Is there any way to visualise what's going on (apart from looking at the animation)?

I've never written in python, but it seems I need to write a new macro for every assembly - any suggestions where I should start?

And ChrisB, is there a module that I can use for collision detection within python?
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: A2Plus part placement

Post by Syres »

You can click on the constraint and select Highlight both constrained parts from the A2Plus menu (magnifying glass icon) which will show a green line on the edge in the case of circularEdge_002_bearing-ref_001 but you will need to look in the Data tab for the definitive edge numbers. So for example, the circularEdge_002_bearing-ref_001 is defined as star-wheel_001 Edge12 (sub Element1) to bearing-ref_001 Edge 21 (Sub Element2)

I thought this example was as simple and close to your requirements with regard to the Python. I would expect you can take a copy of the simulation.py and just change line 20

Code: Select all

sw = doc.getObject("star_wheel_001")
to reflect the label (name) of your wheel/crank.
Post Reply