Habla sobre los modelos
Bases: object
Parameters: |
---|
Generates from a path of File .stp:
-A set of files .geo that represents the geometry of the different simple products that are useful to realize the visualization 3D across the web browser.
-A structure of information that represents the arborescencse of the different assemblies,represented in a Product . (Including his spatial location and orientation and his label of reference (OCC.TDF.TDF_Label))
This class is invoked from three different subprocesses related to the functionality of pythonOCC(generate3D.py , generateComposition.py , generateDecomposition.py).
Parameters: | root_path – Path where to store the files .geo generated |
---|
When we generate a new StepImporter we will refill a list(shapes_simples) whit the SimpleShape contained in the file .stp
For each SimpleShape in the list shapes_simples:
We call the method write_geometries() to generate a file .geo representative of its geometry,the content of the file is identified by the index+1 (>0) of the position of the SimpleShape in the list of SimpleShapes and by the attribue id of StepImporter
Returns the list of the path of the generated .geo files
Class used to represent a simple shape geometry (not assembly)
Model attributes: | |
---|---|
Name of geometry
OCC.TopoDS.TopoDS_Shape that contains the geometry
OCC.Quantity.Quantity_Color that contains information about color of geometry
Parameters: |
|
---|
We are going to expand a Product (product) from the OCC.TDF.TDF_Label who identifies it (product.label_reference)
If the product is an assembly:
We generate the list of the OCC.TDF.TDF_Label that define it
for each OCC.TDF.TDF_Label in list:
We generate a new document3D.classes.Link or if two or more OCC.TDF.TDF_Label of the list are partner, add an occurrence extra to the document3D.classes.Link that already was generated
The document3D.classes.Link is going to point at a new Product or, if the Product is already present in product_root, at the already definite product
If the document3D.classes.Link pointed at a new Product we need to expand it
Else the product is a simple shape:
- We look in the list of shapes_simples for his partner
- We set the attribute product.geometry like the index+1 (>0) of the position of his partner in the list of SimpleShape
Converts location in an array ([x1, x2, x3, x4, y1, y2, y3, y4, z1, z2, z3, z4])
x1 | x2 | x3 | x4 | x | = | x’ |
y1 | y2 | y3 | y4 | y | = | y’ |
z1 | z2 | z3 | z4 | z | = | z’ |
0 | 0 | 0 | 1 | 1 | = | 1 |
Parameters: | location (OCC.TopLoc.TopLoc_Location) – location |
---|
Returns the name of a OCC.TDF.TDF_Label (lab)
Parameters: | lab – OCC.TDF.TDF_Label |
---|