A2Plus part placement

Discussion about the development of the Assembly workbench.
Buddy Hy
Posts: 32
Joined: Sat Aug 31, 2019 11:30 am

A2Plus part placement

Postby Buddy Hy » Sun Sep 15, 2019 12:13 pm

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 14 times
un1corn
Posts: 131
Joined: Sat Dec 26, 2015 2:06 pm

Re: A2Plus part placement

Postby un1corn » Mon Sep 16, 2019 1:36 pm

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 635 times
Buddy Hy
Posts: 32
Joined: Sat Aug 31, 2019 11:30 am

Re: A2Plus part placement

Postby Buddy Hy » Tue Sep 17, 2019 10:47 pm

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
Posts: 1360
Joined: Wed Nov 21, 2018 1:13 pm

Re: A2Plus part placement

Postby kisolre » Wed Sep 18, 2019 5:17 am

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
Posts: 19607
Joined: Tue Mar 17, 2015 9:14 am

Re: A2Plus part placement

Postby chrisb » Wed Sep 18, 2019 10:10 am

Moved to Assembly subforum.
Buddy Hy
Posts: 32
Joined: Sat Aug 31, 2019 11:30 am

Re: A2Plus part placement

Postby Buddy Hy » Wed Sep 18, 2019 10:57 am

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 15 times
chrisb
Posts: 19607
Joined: Tue Mar 17, 2015 9:14 am

Re: A2Plus part placement

Postby chrisb » Wed Sep 18, 2019 12:44 pm

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.
Syres
Posts: 383
Joined: Thu Aug 09, 2018 11:14 am

Re: A2Plus part placement

Postby Syres » Wed Sep 18, 2019 1:22 pm

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

Postby Buddy Hy » Thu Sep 19, 2019 11:01 am

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
Posts: 383
Joined: Thu Aug 09, 2018 11:14 am

Re: A2Plus part placement

Postby Syres » Thu Sep 19, 2019 11:46 am

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.