Class Reference view3dModule

A module with a 3d viewer. More...

Member

void depositReset()
void deposit(int source, bool invert, int thickness, int destLayer=-1, double edgeCover=0)
void depositFill(int soucre, bool invert, int toLevel, int destLayer=-1)
void depositSetLevel(int soucre, bool invert, int toLevel)
void extrude(int source, int bottomLevel, int topLevel, int destLayer=-1)
void extrudeCurrentCell()
void extrudeCurrentSelection()
void extrudeCurrentView()
void extrudeSlant(int source, int bottomLevel, int topLevel, int extensionBottom, int extensionTop,int destLayer=-1)
void extrudeCurved(int source, pointArray edge, int destLayer=-1)
void loadModel(int source,int zLevel, string rotation)
void rotate(int source,double angle=360,int spiral=0,int destLayer=-1)
void syncUnits()
void syncView()
void loadProcessRecipe(string filename)
void saveProcessRecipe(string filename)
void runProcess()
void blockToModel(int sourceLayer,int destLayer, int lower,int upper)
void bottomRoundedBlockToModel(int sourceLayer,int destLayer, int upper,int radius,int steps)
void clearModel()
void export3d( string filename )
void import3d( string filename )
void slantBlockToModel(int sourceLayer,int destLayer, int lower,int upper,int topextension,int bottomextension)
void topRoundedBlockToModel(int sourceLayer,int destLayer, int lower,int radius,int steps)
void trigger3dRenderAll()
void trigger3dRenderSelect()
void trigger3dRenderView()
void trigger3dRenderAuto()
void trigger3dRenderModel()

Detailed Description

graph LR la(layout)--view3dTool-->vm3(view3dModule) click la "/layoutscript/api/layout" click vm3 "/layoutscript/api/view3dmodule" classDef thisClas fill:#eaf5fc,stroke:#3c7faa,stroke-width:4px; classDef clas fill:#eaf5fc,stroke:#3c7faa,stroke-width:1px; class vm3 thisClas class la clas

The 3d build from a 2d layout is reached as layout->view3dTool, a view3dModule. extrude, extrudeSlant and extrudeCurved take a source (a layer number, -1 for the last Boolean result, -2 for the selection, -3 for the whole cell) and absolute z bounds; extrudeCurrentCell, extrudeCurrentSelection and extrudeCurrentView use z values from the Layer Manager. deposit, depositFill and depositSetLevel stack material on the surface left by earlier deposits; depositReset clears that surface. loadProcessRecipe, saveProcessRecipe and runProcess drive the Process tab. syncUnits and syncView match the 3d window to the 2d drawing. Obsolete blockToModel members belong to older releases.

Example:

layout->view3dTool->syncUnits();
layout->view3dTool->depositReset();
layout->view3dTool->extrudeCurrentCell();
layout->view3dTool->syncView();

Member Function Documentation


void view3dModule::depositReset()

Clears the surface remembered from earlier deposit calls.


void view3dModule::deposit(int source, bool invert, int thickness, int destLayer=-1, double edgeCover=0)

Extrudes source onto the surface left by earlier deposits (shapes from extrude do not move that surface). invert inverts the source. thickness is the deposited height. A positive destLayer takes colour from that layer. edgeCover is a relative sidewall cover.

Parameter:
source layer number, or -1 last Boolean, -2 selection, -3 whole cell
invert true to invert the source
thickness deposit thickness
destLayer colour/layer in the 3d view; unused if negative
edgeCover relative edge cover

void view3dModule::depositFill(int soucre, bool invert, int toLevel, int destLayer=-1)

similar to the deposit command, however not a constant thickness will be created but any surface lower the entered level will be filled to this level.

Parameter:
soucre layer number, or -1 last Boolean, -2 selection, -3 whole cell
invert true to invert the source
toLevel target z level
destLayer colour/layer in the 3d view; unused if negative

void view3dModule::depositSetLevel(int soucre, bool invert, int toLevel)

similar to the depositFill command, however no shapes will be output to the 3d window. Only the surface for following depositions will be adjusted.

Parameter:
soucre layer number, or -1 last Boolean, -2 selection, -3 whole cell
invert true to invert the source
toLevel target z level

void view3dModule::extrude(int source, int bottomLevel, int topLevel, int destLayer=-1)

Source shapes all be added and extruded to the layout3d. bottomLevel and topLevel are the z-values. If source is positive it is uses the correspondent layer. A '-1' will use shapes from a previous boolean operation, '-2' will use selected shapes and '-3' will use all shapes of the cell. destLayer if positive will use the layer color of that layer in the layout3d.

Parameter:
source layer number, or -1 last Boolean, -2 selection, -3 whole cell
bottomLevel lower z value
topLevel upper z value
destLayer colour/layer in the 3d view; unused if negative

void view3dModule::extrudeCurrentCell()

The current cell of the layout view will be added to the layout3d with z-values from the LayerManager.


void view3dModule::extrudeCurrentSelection()

The current selection of the layout view will be added to the layout3d with z-values from the LayerManager.


void view3dModule::extrudeCurrentView()

The current layout view will be added to the layout3d with z-values from the LayerManager.


void view3dModule::extrudeSlant(int source, int bottomLevel, int topLevel, int extensionBottom, int extensionTop,int destLayer=-1)

An extrude with slant edges. parameter as identical to the extrude method.

Parameter:
source layer number, or -1 last Boolean, -2 selection, -3 whole cell
bottomLevel lower z value
topLevel upper z value
extensionBottom bottom slant extension
extensionTop top slant extension
destLayer colour/layer in the 3d view; unused if negative

void view3dModule::extrudeCurved(int source, pointArray edge, int destLayer=-1)

Source shapes all be added and extruded to the layout3d. edge describes the edge curve of the extrusion. If source is positive it is uses the correspondent layer. A '-1' will use shapes from a previous boolean operation, '-2' will use selected shapes and '-3' will use all shapes of the cell. destLayer if positive will use the layer color of that layer in the layout3d.

Parameter:
source layer number, or -1 last Boolean, -2 selection, -3 whole cell
edge edge curve
destLayer colour/layer in the 3d view; unused if negative

void view3dModule::loadModel(int source,int zLevel, string rotation)

Text element on the source will be used as model file name for the 3d layout. The model will be added as the text element position on the zLevel. An addition rotation like 'rx180' or 'ry90' can be added. The source parameter is identical to the extrude method.

Parameter:
source layer number, or -1 last Boolean, -2 selection, -3 whole cell
zLevel z position
rotation extra rotation such as rx180

void view3dModule::rotate(int source,double angle=360,int spiral=0,int destLayer=-1)

Shapes on the source will be rotated around the Y-axis. angle is the rotation angle and spiral parameter will make a sprale from the shape. All other parameter are identical to the extrude method.

Parameter:
source layer number, or -1 last Boolean, -2 selection, -3 whole cell
angle angle in degrees
spiral spiral offset; 0 is a plain rotation
destLayer colour/layer in the 3d view; unused if negative

void view3dModule::syncUnits()

Databaseunits and userunits of the layout3d window will be set identical to the layout window. The physical size of the layout3d design is unchanged, the database value of the mesh objects will be adjusted.


void view3dModule::syncView()

The view perspective of the layout window and the layout3d window will be made identical.


void view3dModule::loadProcessRecipe(string filename)

Loads a Process-tab recipe JSON file. The document is {"steps":[...]} (or a bare step array). Lengths are database units.


void view3dModule::saveProcessRecipe(string filename)

Writes the current Process-tab recipe to JSON.


void view3dModule::runProcess()

Runs all enabled Process-tab steps into the current 3D cell.

Obsolete Members


void view3dModule::blockToModel(int sourceLayer,int destLayer, int lower,int upper)

Obsolete

Parameter:
sourceLayer source layer; -1 is the last Boolean result
destLayer colour/layer in the 3d view; unused if negative
lower lower z
upper upper z

Adds the sourcelayer as a block to the model. If sourceLayer equals -1 the result of the last boolean operation is used. lower and upper are the height level of the block. The color setup of the destLayer will be used.


void view3dModule::bottomRoundedBlockToModel(int sourceLayer,int destLayer, int upper,int radius,int steps)

Obsolete

Parameter:
sourceLayer source layer; -1 is the last Boolean result
destLayer colour/layer in the 3d view; unused if negative
upper upper z
radius radius in database units
steps number of rounding steps

Adds the sourceLayer as a block to the model. All edges at the bottom will have a radius. If sourceLayer equals -1 the result of the last boolean operation is used. lower and upper are the height level of the block. The color setup of the destLayer will be used.


void view3dModule::clearModel()

Obsolete

Beside the simple 3d display which uses a level and a hight for each layer and display all struktures as a block there is a alternative way to enable a 3d display. Here a model is used. You had to add all 3d elements to an model and trigger its display via a macro. This method enables more eventualities in the 3d display. You can define implicit boolean operation and you can generate non verticality geometries. Before to start defining a model clear a model with this method. After defining the model with commands like block to model,... trigger a rendering


void view3dModule::export3d( string filename )

Obsolete

Saves the current 3d model to a dxf file. Only the mesh is stored; the view (angle and magnification) is ignored. User units become DXF units.


void view3dModule::import3d( string filename )

Obsolete

Loads a 3d dxf file into the 3d window. Layers with matching names are mapped; unknown layers go to layer 0. Only visible layers are shown. The 2d window’s current view is used as the starting camera, so open and scale-full the layout first.


void view3dModule::slantBlockToModel(int sourceLayer,int destLayer, int lower,int upper,int topextension,int bottomextension)

Obsolete

Parameter:
sourceLayer source layer; -1 is the last Boolean result
destLayer colour/layer in the 3d view; unused if negative
lower lower z
upper upper z
topextension top slant extension
bottomextension bottom slant extension

Adds the sourceLayer to the model. If sourceLayer equals -1 the result of the last boolean operation is used. The color setup of the destLayer will be used.


void view3dModule::topRoundedBlockToModel(int sourceLayer,int destLayer, int lower,int radius,int steps)

Obsolete

Parameter:
sourceLayer source layer; -1 is the last Boolean result
destLayer colour/layer in the 3d view; unused if negative
lower lower z
radius radius in database units
steps number of rounding steps

Adds the sourceLayer as a block to the model. All edges at the top will have a radius. If sourceLayer equals -1 the result of the last boolean operation is used. lower and upper are the height level of the block. The color setup of the destLayer will be used.


void view3dModule::trigger3dRenderAll()

Obsolete

renderAll will be called after the macro terminates or the user interface is updated.


void view3dModule::trigger3dRenderSelect()

Obsolete

renderSelect will be called after the macro terminates or the user interface is updated.


void view3dModule::trigger3dRenderView()

Obsolete

renderView will be called after the macro terminates or the user interface is updated.


void view3dModule::trigger3dRenderAuto()

Obsolete

renderAuto will be called after the macro terminates or the user interface is updated.


void view3dModule::trigger3dRenderModel()

Obsolete

renderModel will be called after the macro terminates or the user interface is updated.