Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gbroques/freecad-dynamic-linked-object
Example of using a dynamic linked object in an assembly.
https://github.com/gbroques/freecad-dynamic-linked-object
assembly freecad link
Last synced: about 1 month ago
JSON representation
Example of using a dynamic linked object in an assembly.
- Host: GitHub
- URL: https://github.com/gbroques/freecad-dynamic-linked-object
- Owner: gbroques
- Created: 2021-04-01T01:40:31.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-11-05T22:05:46.000Z (over 2 years ago)
- Last Synced: 2024-11-13T03:15:03.510Z (3 months ago)
- Topics: assembly, freecad, link
- Homepage:
- Size: 343 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FreeCAD Example: Dynamic Linked Object
Link (internally `App::Link`) is an important new feature introduced in FreeCAD 0.19 assemblies.
This repository aims to layout one pattern for complex assemblies involving *dynamic linked objects* which aims to reduce duplication of assembly related logic such as orientation, positioning, or number of instances.
## Example
To illustrate the dynamic linked object concept, consider a table with four legs.Each leg has two different variants:
* Round
* and SquareThe variants can be controlled by a parameter in a spreadsheet.
For our table model, we'll create **five** separate documents:
1. `TableTop.FCStd` - containing the top of the table.
2. `RoundTableLeg.FCStd` - containing a ''round'' table leg.
3. `SquareTableLeg.FCStd` - containing a ''square'' table leg.
4. `Table.FCStd` - containing the assembly of the table top and legs.
5. `Spreadsheet.FCStd` - containing a spreadsheet to drive the model.Our simple table model will define the following parameters in `Spreadsheet.FCStd`:
1. `TableTopSize` - Dimension of the **square** table top.
2. `TableTopThickness` - Thickness of the table top.
3. `TableLegSize` - Size of each table leg. For Square leg, this is the dimension. For Round leg, this is the diameter.
4. `TableLegHeight` - Height of each table leg.
5. `TableLegVariant` - Controls the style of table leg. Possible values include "`Square`" and "`Round`".`Table.FCStd` is where the dynamic linked object concept is illustrated.
The goal is to *not* duplicate the following assembly logic for each table leg variant:
* Each table leg must appear **four** times underneath each corner of the table top.How this is accomplished:
* The `TableTop` and one of the TableLeg objects (Round or Square) are linked into the `Table` document.
* The TableLeg link is renamed to `TableLeg` and the "Linked Object" property is changed to the following conditional expression:
* `<>#Spreadsheet.TableLegVariant == <> ? <>#<>._self : <>#<>._self`
* Each table leg must appear **four** times underneath each corner of the table top so an [orthogonal array](https://wiki.freecadweb.org/Draft_OrthoArray) is created using the parametric `TableLeg` link as a base object.![Dynamic Table Leg](dynamic-table-leg.gif)
## See Also
https://wiki.freecadweb.org/Dynamic_linked_object