Classes | |
class | ProjectImporter |
Functions | |
def | applyColorDict (doc, colordict=None) |
def | buildRelAdditions (ifcfile) |
def | buildRelColors (ifcfile, prodrepr) |
def | buildRelGroups (ifcfile) |
def | buildRelMaterialColors (ifcfile, prodrepr) |
def | buildRelMattable (ifcfile) |
def | buildRelProductColors (ifcfile, prodrepr) |
def | buildRelProductRepresentation (ifcfile) |
def | buildRelProductsAnnotations (ifcfile, root_element='IfcProduct') |
def | buildRelProperties (ifcfile) |
def | buildRelSubtractions (ifcfile) |
def | createAnnotation (annotation, doc, ifcscale, preferences) |
def | createFromProperties (propsets, ifcfile, parametrics) |
def | dd2dms (dd) |
def | decode (filename, utf=False) |
def | dms2dd (degrees, minutes, seconds, milliseconds=0) |
def | get2DShape (representation, scaling=1000) |
def | getColorFromMaterial (material) |
def | getColorFromProduct (product) |
def | getColorFromStyledItem (styled_item) |
def | getIfcProperties (ifcfile, pid, psets, d) |
def | getIfcPropertySets (ifcfile, pid) |
def | getIfcPsetProperties (ifcfile, pid) |
def | getParents (ifcobj) |
def | getPlacement (entity, scaling=1000) |
def | getProfileCenterPoint (sweptsolid) |
def | getRotation (entity) |
def | getScaling (ifcfile) |
def | getUnit (unit) |
def | getVector (entity, scaling=1000) |
def | isRectangle (verts) |
def | predefined_to_rgb (rgb_color) |
Variables | |
bool | DEBUG_prod_colors = False |
bool | DEBUG_prod_repr = False |
dictionary | PREDEFINED_RGB |
def importIFCHelper.applyColorDict | ( | doc, | |
colordict = None |
|||
) |
applies the contents of a color dict to the objects in the given doc. If no colordict is given, the doc Meta property is searched for a "colordict" entry.
def importIFCHelper.buildRelAdditions | ( | ifcfile | ) |
Build the additions relation table.
Referenced by importIFC.insert().
def importIFCHelper.buildRelColors | ( | ifcfile, | |
prodrepr | |||
) |
Build the colors relation table. Returns all IfcStyledItem colors, material and product colors. Returns ------- dict A dictionary with `{id: (r,g,b), ...}` values.
def importIFCHelper.buildRelGroups | ( | ifcfile | ) |
Build the groups relation table.
Referenced by importIFC.insert().
def importIFCHelper.buildRelMaterialColors | ( | ifcfile, | |
prodrepr | |||
) |
def importIFCHelper.buildRelMattable | ( | ifcfile | ) |
Build the mattable relation table.
Referenced by importIFC.insert().
def importIFCHelper.buildRelProductColors | ( | ifcfile, | |
prodrepr | |||
) |
Build the colors relation table from a product. Returns ------- dict A dictionary with `{id: (r,g,b), ...}` values.
References getColorFromStyledItem().
Referenced by importIFC.insert().
def importIFCHelper.buildRelProductRepresentation | ( | ifcfile | ) |
Build the product/representations relation table.
Referenced by importIFC.insert().
def importIFCHelper.buildRelProductsAnnotations | ( | ifcfile, | |
root_element = 'IfcProduct' |
|||
) |
Build the products and annotations relation table.
Referenced by importIFC.insert().
def importIFCHelper.buildRelProperties | ( | ifcfile | ) |
Builds and returns a dictionary of {object:[properties]} from an IFC file
def importIFCHelper.buildRelSubtractions | ( | ifcfile | ) |
Build the subtractions relation table.
Referenced by importIFC.insert().
def importIFCHelper.createAnnotation | ( | annotation, | |
doc, | |||
ifcscale, | |||
preferences | |||
) |
creates an annotation object
References get2DShape(), and getPlacement().
Referenced by importIFCmulticore.insert(), and importIFC.insert().
def importIFCHelper.createFromProperties | ( | propsets, | |
ifcfile, | |||
parametrics | |||
) |
Creates a FreeCAD parametric object from a set of properties.
Referenced by importIFC.insert().
def importIFCHelper.dd2dms | ( | dd | ) |
Convert decimal degrees to degrees, minutes, seconds. Used in export.
def importIFCHelper.decode | ( | filename, | |
utf = False |
|||
) |
Turn unicode into strings, only for Python 2.
Referenced by importIFC.insert(), importSHP.open(), and importIFC.open().
def importIFCHelper.dms2dd | ( | degrees, | |
minutes, | |||
seconds, | |||
milliseconds = 0 |
|||
) |
Convert degrees, minutes, seconds to decimal degrees. Used in import.
Referenced by importIFC.insert().
def importIFCHelper.get2DShape | ( | representation, | |
scaling = 1000 |
|||
) |
Returns a shape from a 2D IfcShapeRepresentation
References DraftVecUtils.angle(), get2DShape(), draftfunctions.svgshapes.getCircle(), getPlacement(), getRotation(), and getVector().
Referenced by createAnnotation(), get2DShape(), and getProfileCenterPoint().
def importIFCHelper.getColorFromMaterial | ( | material | ) |
References getColorFromStyledItem().
Referenced by importIFCmulticore.createMaterial().
def importIFCHelper.getColorFromProduct | ( | product | ) |
Referenced by importIFCmulticore.setColor().
def importIFCHelper.getColorFromStyledItem | ( | styled_item | ) |
Get color from the IfcStyledItem. Returns ------- float, float, float, int A tuple with the red, green, blue, and transparency values. If the `IfcStyledItem` is a `IfcDraughtingPreDefinedColour` the transparency is set to 0. The first three values range from 0 to 1.0, while the transparency varies from 0 to 100. None Return `None` if `styled_item` is not of type `'IfcStyledItem'` or if there is any other problem getting a color.
References predefined_to_rgb().
Referenced by buildRelProductColors(), and getColorFromMaterial().
def importIFCHelper.getIfcProperties | ( | ifcfile, | |
pid, | |||
psets, | |||
d | |||
) |
builds valid property values for FreeCAD
Referenced by getIfcPsetProperties(), and importIFC.insert().
def importIFCHelper.getIfcPropertySets | ( | ifcfile, | |
pid | |||
) |
Returns a dictionary of {pset_id:[prop_id, prop_id...]} for an IFC object
Referenced by getIfcPsetProperties(), and importIFC.insert().
def importIFCHelper.getIfcPsetProperties | ( | ifcfile, | |
pid | |||
) |
directly build the property table from pid and ifcfile for FreeCAD
References getIfcProperties(), and getIfcPropertySets().
def importIFCHelper.getParents | ( | ifcobj | ) |
finds the parent entities of an IFC entity
Referenced by importIFCmulticore.createModelStructure().
def importIFCHelper.getPlacement | ( | entity, | |
scaling = 1000 |
|||
) |
returns a placement from the given entity
References getPlacement(), DraftVecUtils.getPlaneRotation(), and getVector().
Referenced by createAnnotation(), get2DShape(), getPlacement(), and getProfileCenterPoint().
def importIFCHelper.getProfileCenterPoint | ( | sweptsolid | ) |
returns the center point of the profile of an extrusion
References get2DShape(), and getPlacement().
Referenced by importIFC.insert().
def importIFCHelper.getRotation | ( | entity | ) |
returns a FreeCAD rotation from an IfcProduct with a IfcMappedItem representation
References WorkingPlane.plane.
Referenced by get2DShape(), and importIFC.insert().
def importIFCHelper.getScaling | ( | ifcfile | ) |
Return a scaling factor from the IFC file; units to mm.
References getUnit().
Referenced by importIFCmulticore.insert(), and importIFC.insert().
def importIFCHelper.getUnit | ( | unit | ) |
Get the unit multiplier for different decimal prefixes. Only for when the unit is METRE. When no Prefix is provided, return 1000, that is, mm x 1000 = metre. For other cases, return 1.0.
Referenced by getScaling().
def importIFCHelper.getVector | ( | entity, | |
scaling = 1000 |
|||
) |
returns a vector from the given entity
Referenced by get2DShape(), and getPlacement().
def importIFCHelper.isRectangle | ( | verts | ) |
returns True if the given 4 vertices form a rectangle
Referenced by importIFC.insert().
def importIFCHelper.predefined_to_rgb | ( | rgb_color | ) |
Transform a predefined color name to its [r, g, b] representation. TODO: at the moment it doesn't handle 'by layer'. See: `IfcDraughtingPreDefinedColour` and `IfcPresentationLayerWithStyle`.
Referenced by getColorFromStyledItem().
bool importIFCHelper.DEBUG_prod_colors = False |
bool importIFCHelper.DEBUG_prod_repr = False |
dictionary importIFCHelper.PREDEFINED_RGB |