I guess it could be done with expressions. You'd need a way to calculate the new properties of the array to use those variables that you define.
Assembly 4 workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Assembly 4 workbench
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: Assembly 4 workbench
Thank you for this feature. This is an nice addition to the Fastener tool which helps to facilitate top-down, in-context design using Assembly4.
The following model of an air motor prototype design by Ken Irwin (2011) is a example of the top-down work process I am trying to develop and refine. See the real deal at https://www.youtube.com/watch?v=C1oe3oULlD0 and several screen shots of my model below with a few comments about my modelling strategy.
Model can be downloaded from https://www.dropbox.com/s/qlud995qng29f ... FCStd?dl=0
Any comments or questions are valuable since I am in the early stages of trying to develop this process using Assembly4 where it may make sense. In retrospect, I probably should have put the master sketch in the Model Assembly as Zolko recommends to avoid the dreaded "Links out of scope" warnings. I'll try that in my next learning project. EDIT: See also https://forum.freecadweb.org/viewtopic.php?f=24&t=41135
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18719 (Git)
Build type: Release
Branch: master
Hash: c021ff70debb106b27d03ed1707f4b05fcf385a6
Python version: 3.6.7
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
Last edited by ppemawm on Sat Nov 23, 2019 6:23 pm, edited 1 time in total.
"It is a poor workman who blames his tools..."
- alonso_jamm
- Posts: 77
- Joined: Mon Nov 11, 2019 11:32 pm
Re: Assembly 4 workbench
After a little bit of research I found out that we could use the addExtension method to add the functionality of attachment to an array (similar to what we do with LCS).
For example, I used this line of code:
Then the polar array named "array_part1" had the ability to be attached just like a LCS. I attached the array to a LCS and after rotating and moving the LCS, the array would follow. So doing this give the ability to position an array in any direction.
The problem is that the attachment happens with one of the elements of the array (I think is the first element). That is, the attachment does not happen at the center of the polar array. Also, this method does not help on having a parametric distance between the center and the elements of the array. But I think it may be useful for positioning the array.
For example, I used this line of code:
Code: Select all
App.ActiveDocument.array_part1.addExtension("Part::AttachExtensionPython", App.ActiveDocument.array_part1)
The problem is that the attachment happens with one of the elements of the array (I think is the first element). That is, the attachment does not happen at the center of the polar array. Also, this method does not help on having a parametric distance between the center and the elements of the array. But I think it may be useful for positioning the array.
- alonso_jamm
- Posts: 77
- Joined: Mon Nov 11, 2019 11:32 pm
Re: Assembly 4 workbench
I did some testing with the expression engine. I was able to make the array parametric. The screws follow the holes! I achieved this by creating expressions for the coordinates of the center of the array. I placed a LCS in the center of the pipe, and used that as reference. Then I
The steps I used were:
- Got the difference of the placements of the LCS called "CENTER" (This is the LCS considered as center of the array) and the LCS called "Hole" (the screw is attached to this LCS).
- I multiplied the resultant placement by the rotation of the LCS "Hole".
I attached the file
- Attachments
-
- test_LinkArray.FCStd
- (155.54 KiB) Downloaded 66 times
Re: Assembly 4 workbench
Maybe this could be added to the code of Draft_Array itself.alonso_jamm wrote: ↑Fri Nov 22, 2019 11:41 pm ...Then the polar array named "array_part1" had the ability to be attached just like a LCS. ...Code: Select all
App.ActiveDocument.array_part1.addExtension("Part::AttachExtensionPython", App.ActiveDocument.array_part1)
Most Draft objects like lines, circles, rectangles, etc., are derived from Part_Part2DObject because they are supposed to be planar objects. Therefore, all these include the AttachExtension by default, so that they can be attached to faces and other planes. Sketches are also Part_Part2DObjects.
But Draft_Array isn't a planar object in general, as it can be used with any object, both 2D and 3D. The array is based on a Part_Feature so it doesn't include the AttachExtension by default.
I don't know whether it would be a problem to provide this property to all arrays. What is the consequence of a 3D body having an AttachExtension? Why don't all objects have this by default? Does this make the object "heavier", consuming more memory?
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
- alonso_jamm
- Posts: 77
- Joined: Mon Nov 11, 2019 11:32 pm
Re: Assembly 4 workbench
I am not completely sure what are the consequences of adding an AttachExtension to all arrays. I am still having troubles in understanding completely what are extensions. But as far as I understand, AttachExtension adds the functionality of the Attacher::AttachEngine. And also I don't know if it makes an object "heavier" nor why it is not implemented by default on all objects. My guess is that it is not implemented in all objects because it is a relatively new feature.
Re: Assembly 4 workbench
yes, that was my first thought: you definitively should do that. But it won't get you rid of the Links out of scope, because that's a FreeCAD "bug" (feature: LCS are PartDesign::CoordinateSystem objects, and when used outside of a PartDesign::Body it complains. It works very well, but it complains.)
While I was sceptical about your idea of an assembly in a file, it is nice to be able to distribute it easily in 1 file.
Also: did you think about animating it ?
Re: Assembly 4 workbench
There are 3 Sketches there:
- Sketch_Master
- Sketch001_CC
- Sketch001_CC029
There is a feature in Sketcher that allows to import external references. This means that you could solve the first sketch for all constraints, then import in your subsequent sketches only the vertices of the (solved) master sketch, and add geometries there. You may run into the topological naming issue, but it's much less bad for sketches than for 3D geometries.
EDIT: hold-on : there are actually tens of CarbonCopies of the master sketch, one in each part: are they all solved ? That would explain why it's so slow to update
EDIT 2: What I would try is to make the first master sketch (in the assembly Model) that solves the position of each wheel running inside the excenter, and then, outside the Sketch, at the root of the assembly Model, place 6 datum points on the centres of these 6 wheels: this is actually the only information that you need. And then, import these datum points into secondary sketches as needed. Thus, if/when the master sketch screws up with the topological naming, the secondary sketches will still be valid since they point to valid reference datum points. They will be geometrically messed-up but topologically valid: all you'll have to do is to correctly reposition the datum points.
Re: Assembly 4 workbench
All carbon copies are from the master sketch. Carbon copies of carbon copies is probably not the best practice. I duplicate the "master" carbon copy to avoid having to create a new carbon copy for each feature. It is simply a time saving while modelling. This has been my standard practice when using master sketches since introduction in V0.17.
I do not know if each carbon copy is solved, but it stands to (my) reason that each is solved as it is encountered in the model tree.
I generally (religiously) avoid external references in sketches unless they refer to another sketch. I'll try your suggestion with my next project. I do not know if external reference is any more robust than carboncopy which is simply based on expressions for the dimensions.Zolko wrote: ↑Sun Nov 24, 2019 9:03 am There is a feature in Sketcher that allows to import external references. This means that you could solve the first sketch for all constraints, then import in your subsequent sketches only the vertices of the (solved) master sketch, and add geometries there. You may run into the topological naming issue, but it's much less bad for sketches than for 3D geometries.
Building models in separate files or adding standard parts such as fasteners or .step objects and then creating an assembly file works fine if the assembly arrangement is already known.
My past design experience was with bespoke or one-off prototype turbomachines which usually started with the layout of a cross-section(s) of the assembly by the senior designer who fixes the arrangement and critical dimensions and interfaces. This layout (master sketch) was then used by the juniors detailers to create the drawings (models) for each component. In the CAD world, I do not see how the individual 3D models can be created out-of-context, thus the requirement to have all parts in the same file while creating the Part models and the assembly. That is the work process I am trying to develop with FreeCAD. So far, from my limited experimenting, Assembly4 is the only workbench that may facilitate this work process so far.
Thank you for the animation. I do have an animation by 'image-to-GIF or Microsoft video MP4, but the files were too large to attach. Unless it is an illusion it seems in your animation that the gear teeth rotate opposite to the eccentric at a different speed. Is this a anomaly with the animation or is there something amiss with my model?
I'll give this a try in one of my next projects and report back. I assume you mean by "import" to use Sketcher external reference.Zolko wrote: ↑Sun Nov 24, 2019 9:03 am What I would try is to make the first master sketch (in the assembly Model) that solves the position of each wheel running inside the excenter, and then, outside the Sketch, at the root of the assembly Model, place 6 datum points on the centres of these 6 wheels: this is actually the only information that you need. And then, import these datum points into secondary sketches as needed.
Now that we have Assembly4 and Link capability in V0.19 perhaps the process should evolve to:
1. Create master assembly file with the master layout (sketch).
2. Create first Part with Body in the assembly file referencing the master sketch for each feature.
3. Export Part with its link to the mastersketch to a separate file.
4. Delete(?) #2 and add external Part to the assembly file with a Link(?) so that there is an instance in the assembly file that facilitates in-context modelling of the the next part(s).
5. Repeat for each Part in the same sequence as one may assemble the actual machine.
So, I have some more experimenting to do with Assembly4.
"It is a poor workman who blames his tools..."
Re: Assembly 4 workbench
new version 0.7.4: I added an animate command. It allows to easily move parts in an Assembly4 assembly, by setting a variable in the Variables entity. It's very basic, and the STOP button and SLEEP value don't work.