-
Notifications
You must be signed in to change notification settings - Fork 23
Component Definitions
General conventions:
- Component definition naming should follow clear convention. In the case of an off-the-shelf component, the name should follow: type_of_component_partnumber, ie mirror_mount_km01 For custom components try to use highly descriptive names such as isomet_aom_bracket_for_km100.
- Transparency in calculations. Always try to make it clear where positions or value are derived from. If possible, it is always best to define any important positions as class constants with clear names, then reference them as needed. Hand calculating values from measurements and then hardcoding them in is typically discouraged.
The following properties are available to be define in component definition:
Pre-defined class constants such as:
- object_color: The color of the geometry
- object_icon: The icon displayed in FreeCAD tree view
- object_group: The group the object belongs to
- object_transparency: The transparency of the geometry As well as any additional constants such as positions used for geometry or mounting.
The init function is where you should define all user-adjustable parameter
This function defined the objects geometry, it should return a FreeCAD Part object. Refer to FreeCAD documentation for more info on how to create parts.
Define geometry mesh. This can be used instead of shape() for mesh-based components. See model importing for more details on adding a model to the library
This function should return a list of components which will be automatically added to the component when added to a layout. Use the subcomponent namedTuple object to define the definition and placement of the subcomponent.
This defines the drilling which will be automatically cut from all parents and peers of this object in the layout. It must return a FreeCAD part object.
Define any optical interfaces for this component. This should return a list of optical interfaces that define the optical properties of the component.