Changes

Glossary of EM.Cube's Python Functions

503 bytes added, 01:29, 18 September 2016
/* EM.Cube's Python Functions for Geometric Object Transformation */
====freeze====
SYNTAX: freeze({{ArgTypeString}} object, {{ArgTypeReal}} freeze_state)
EXAMPLE: ''Example: freeze("MyObj",1)''
DescriptionDESCRIPTION: Sets the freeze state of an object (0/1).
====move_to====
SYNTAX: move_to({{ArgTypeString}} object, {{ArgTypeString}} group_node_label[, {{ArgTypeString}} module_name])
EXAMPLE: ''Example: move_to("NewObj","MyObj",10,10,0)''
DescriptionDESCRIPTION: Transfers an object from its current material/object group node in the navigation tree to another node or optionally to another [[EM.Cube]] module.
====clone====
SYNTAX: clone({{ArgTypeString}} label, {{ArgTypeString}} object, {{ArgTypeReal}} x0, {{ArgTypeReal}} y0, {{ArgTypeReal}} z0)
EXAMPLE: ''Example: clone("NewObj","MyObj",10,10,0)''
DescriptionDESCRIPTION: Creates a copy of the specified object and repositions it at the given coordinates.
====translate_by====
SYNTAX: translate_by({{ArgTypeString}} object, {{ArgTypeReal}} x_dist, {{ArgTypeReal}} y_dist, {{ArgTypeReal}} z_dist)
EXAMPLE: ''Example: translate_by("MyObj",10,10,x)''
DescriptionDESCRIPTION: Translates an object by the specified distances in each direction.
====translate_to====
SYNTAX: translate_to({{ArgTypeString}} object, {{ArgTypeReal}} x_dest, {{ArgTypeReal}} y_dest, {{ArgTypeReal}} z_dest)
EXAMPLE: ''translate_to({{ArgTypeString}} object"MyObj", {{ArgTypeReal}} x_dest20, {{ArgTypeReal}} y_dest20, {{ArgTypeReal}} z_destx2)''
''Example: translate_to("MyObj",20,20,x2)'' DescriptionDESCRIPTION: Translates an object to the specified destination.
====rotate====
SYNTAX: rotate({{ArgTypeString}} object, {{ArgTypeAny}} rot_angle_degree, {{ArgTypeAny}} rot_axis_x, {{ArgTypeAny}} rot_axis_y, {{ArgTypeAny}} rot_axis_z)
EXAMPLE: ''Example: rotate("pyramid_1",45,1,1,0)''
DescriptionDESCRIPTION: Rotates an object about a line passing through its LCS center and aligned along the specified direction vector (rot_axis) by the specified angle.
====scale====
SYNTAX: scale({{ArgTypeString}} object, {{ArgTypeAny}} scale_factor)
EXAMPLE: ''Example: scale("pyramid_1",2)''
DescriptionDESCRIPTION: Scales an object by the specified scale factor.
====get_length====
SYNTAX: get_length({{ArgTypeString}} object)
EXAMPLE: ''Example: get_length("helix_1")''
DescriptionDESCRIPTION: Returns the length of a curve object.
====get_area====
SYNTAX: get_area({{ArgTypeString}} object)
EXAMPLE: ''Example: get_area("ellipse_1")''
DescriptionDESCRIPTION: Returns the area of a surface object or the total surface area of a solid object.
====get_volume====
SYNTAX: get_volume({{ArgTypeString}} object)
EXAMPLE: ''Example: get_volume("pyramid_1")''
DescriptionDESCRIPTION: Returns the volume of a solid object.
====get_lcs====
SYNTAX: get_lcs({{ArgTypeString}} object, {{ArgTypeString}} coordinate)
EXAMPLE: ''Example: get_lcs("pyramid_1","x")''
DescriptionDESCRIPTION: Returns the specified coordinate of the LCS of an object.
====get_rot====
SYNTAX: get_rot({{ArgTypeString}} object, {{ArgTypeString}} coordinate)
EXAMPLE: ''Example: get_rot("pyramid_1","x")''
DescriptionDESCRIPTION: Returns the specified rotation angle of an object.
====get_axis====
SYNTAX: get_axis({{ArgTypeString}} object, {{ArgTypeString}} axis, {{ArgTypeString}} coordinate)
EXAMPLE: ''Example: get_axis("pyramid_1","x","y")''
DescriptionDESCRIPTION: Returns the specified coordinate of the unit vector along the specified local axis of an object.
====get_lcs_offset====
SYNTAX: get_lcs_offset({{ArgTypeString}} object, {{ArgTypeAny}} x_off, {{ArgTypeAny}} y_off, {{ArgTypeAny}} z_off, {{ArgTypeString}} coordinate)
EXAMPLE: ''Example: get_lcs_offset("box_1",50,50,0,"x")''
DescriptionDESCRIPTION: Returns the specified coordinate of the LCS of an object after being translated by the specified offset values along the three principal axes.
====get_extent====
SYNTAX: get_extent({{ArgTypeString}} object, {{ArgTypeString}} coordinate)
EXAMPLE: ''Example: get_extent("pyramid_1","x")''
DescriptionDESCRIPTION: Returns the size of the bounding box of an object along the specified direction.
====get_vertex====
SYNTAX: get_vertex({{ArgTypeString}} object, {{ArgTypeAny}} node_index, {{ArgTypeString}} coordinate)
EXAMPLE: ''Example: get_vertex("pyramid_1",0,"x")''
DescriptionDESCRIPTION: Returns the specified coordinate of the specified vertex of the bounding box of an object. The vertices are specified by node indices. The lower front left corner has an index of 0, while the upper back right corner has an index of 7. The indices are numbered counterclockwise, with the bottom face first and top face next.
====set_rot====
SYNTAX: set_rot({{ArgTypeString}} object, {{ArgTypeAny}} rot_x, {{ArgTypeAny}} rot_y, {{ArgTypeAny}} rot_z)
EXAMPLE: ''Example: set_rot("pyramid_1",0,0,45)''
DescriptionDESCRIPTION: Sets the three rotation angles of an object.
====set_lcs_link====
SYNTAX: set_lcs_link({{ArgTypeString}} object, {{ArgTypeString}} lcs_obj, {{ArgTypeAny}} x_off, {{ArgTypeAny}} y_off, {{ArgTypeAny}} z_off)
EXAMPLE: ''Example: set_lcs_link("pyramid_1","box_1",50,50,0)''
DescriptionDESCRIPTION: Links the LCS of the first object to the LCS of the second object by the specified offset values along the three axes.
====set_rot_link====
SYNTAX: set_rot_link({{ArgTypeString}} object, {{ArgTypeString}} lcs_obj, {{ArgTypeAny}} x_off_deg, {{ArgTypeAny}} y_off_deg, {{ArgTypeAny}} z_off_deg)
EXAMPLE: ''Example: set_rot_link("pyramid_1","box_1",0,0,45)''
DescriptionDESCRIPTION: Links the rotation angles of the LCS of the first object to the rotation angles of the LCS of the second object by the specified angle offset values in degrees along the three axes.
====mirror====
SYNTAX: mirror({{ArgTypeString}} object, {{ArgTypeAny}} x0, {{ArgTypeAny}} y0, {{ArgTypeAny}} z0, {{ArgTypeAny}} uX, {{ArgTypeAny}} uY, {{ArgTypeAny}} uZ)
EXAMPLE: ''Example: mirror("pyramid_1",0,0,0,1,0,0)''
DescriptionDESCRIPTION: Mirrors an object in a plane defined by the specified point coordinates and specified normal vector components.
====group====
SYNTAX: group({{ArgTypeString}} label, {{ArgTypeString}} object_1, {{ArgTypeString}} object_2, ...)
EXAMPLE: ''Example: group("Composite_1","Box_1","Box_2","Box_3")''
DescriptionDESCRIPTION: Groups a number of objects into a composite object with the given label.
====array====
SYNTAX: array({{ArgTypeString}} label, {{ArgTypeString}} object, {{ArgTypeAny}} x_count, {{ArgTypeAny}} y_count, {{ArgTypeAny}} z_count, {{ArgTypeAny}} x_spacing, {{ArgTypeAny}} y_spacing, {{ArgTypeAny}} z_spacing)
EXAMPLE: ''Example: array("Array_1","Rect_Strip_1",4,4,1,50,50,0)''
DescriptionDESCRIPTION: Creates or modifies an array object.
====array_custom====
SYNTAX: array_custom({{ArgTypeString}} label, {{ArgTypeString}} object, {{ArgTypeAny}} x_count, {{ArgTypeAny}} y_count, {{ArgTypeAny}} z_count, {{ArgTypeAny}} x_spacing, {{ArgTypeAny}} y_spacing, {{ArgTypeAny}} z_spacing, {{ArgTypeAny}} x0, {{ArgTypeAny}} y0, {{ArgTypeAny}} z0, {{ArgTypeAny}} rot_x, {{ArgTypeAny}} rot_y, {{ArgTypeAny}} rot_z)
EXAMPLE: ''Example: array_custom("Array_1","Rect_Strip_1",4,4,1,50,50,0,100,100,20,0,0,45)''
DescriptionDESCRIPTION: Creates or modifies an array object and sets its local coordinate system and rotation angles.
====explode====
SYNTAX: explode({{ArgTypeString}} object)
EXAMPLE: ''Example: explode("MyArray")''
DescriptionDESCRIPTION: Explodes an object into its basic primitives.
====subtract====
SYNTAX: subtract({{ArgTypeString}} label, {{ArgTypeString}} object_1, {{ArgTypeString}} object_2)
EXAMPLE: ''Example: subtract("Subtract_Object","Rect_Strip1","Rect_Strip2")''
DescriptionDESCRIPTION: Creates a Boolean object named 'label' by subtracting object_2 from object_1. An error will be thrown if a Boolean object named 'label' already exists.
====union====
SYNTAX: union({{ArgTypeString}} label, {{ArgTypeString}} object_1, {{ArgTypeString}} object_2)
EXAMPLE: ''Example: union("Union_Object","Rect_Strip1","Rect_Strip2")''
DescriptionDESCRIPTION: Creates a Boolean object named 'label' by unioning object_1 and object_2. An error will be thrown if a Boolean object named 'label' already exists.
====intersect====
SYNTAX: intersect({{ArgTypeString}} label, {{ArgTypeString}} object_1, {{ArgTypeString}} object_2)
EXAMPLE: ''Example: intersect("Intersection_Object","Rect_Strip1","Rect_Strip2")''
DescriptionDESCRIPTION: Creates a Boolean object named 'label' by intersecting object_1 and object_2. An error will be thrown if a Boolean object named 'label' already exists.
====extrude====
SYNTAX: extrude({{ArgTypeString}} label, {{ArgTypeString}} object, {{ArgTypeAny}} extrude_height, {{ArgTypeAny}} cap_ends)
EXAMPLE: ''Example:extrude("Extrude_1","Rect_Strip1",50)''
DescriptionDESCRIPTION: Creates or modifies an extrusion object from a specified object by the specified height. If modifying an existing extrusion object, the pre-existing primitive is used. This command can only extrude objects that have a single face and will extrude along the face's normal.
====loft====
SYNTAX: loft({{ArgTypeString}} label, {{ArgTypeString}} object, {{ArgTypeAny}} loft_height, {{ArgTypeAny}} cap_base)
EXAMPLE: ''Example: loft("Loft_1","Rect_Strip1",50)''
DescriptionDESCRIPTION: Creates or modifies a loft object from a specified object by the specified height. If modifying an existing loft object, the pre-existing primitive is used. This command can only loft objects that have a single face and will loft along the face's normal.
====revolve====
SYNTAX: revolve({{ArgTypeString}} label, {{ArgTypeString}} object, {{ArgTypeAny}} x0, {{ArgTypeAny}} y0, {{ArgTypeAny}} z0, {{ArgTypeAny}} uX, {{ArgTypeAny}} uY, {{ArgTypeAny}} uZ, {{ArgTypeAny}} rot_angle) EXAMPLE: ''revolve("Rev1","Line_1",0,0,0,0,0,1,360)'' DESCRIPTION: Creates or modifies a revolution object from a specified object. If modifying an existing revolution object, the pre-existing primitive object is used. (x0,y0,z0) specifies the center of revolution, and (uX,uY,uZ) specifies the revolution axis. The revolution angle "rot_angle" is given in degrees. ====consolidate==== SYNTAX: consolidate({{ArgTypeString}} object) EXAMPLE: ''consolidate("Poly_1")'' DESCRIPTION: Consolidates a specified object. ====spline_fit==== SYNTAX: spline_fit({{ArgTypeString}} object) EXAMPLE: ''spline_fit("Poly_1")'' DESCRIPTION: Applies spline fit transformation on a specified polymesh, polyline or polystrip object. ====fill_curve==== SYNTAX: fill_curve({{ArgTypeString}} object) EXAMPLE: ''fill_curve("Curve_1")'' DESCRIPTION: Fill the interior of the specified closed curve object.
''Example: revolve("Rev1","Line_1",0,0,0,0,0,1,360)''====merge_curve====
DescriptionSYNTAX: Creates or modifies a revolution object from a specified object. If modifying an existing revolution object, the pre-existing primitive object is used. merge_curve(x0,y0,z0) specifies the center of revolution, and (uX,uY{{ArgTypeString}} object_1,uZ{{ArgTypeString}} object_2) specifies the revolution axis. The revolution angle "rot_angle" is given in degrees.
====consolidateEXAMPLE: ''merge_curve({{ArgTypeString}} object"Curve_1","Curve_2")====''
''ExampleDESCRIPTION: consolidate("Poly_1")''Merges two specified curve objects into a single curve.
Description: Consolidates a specified object.====close_curve====
====spline_fitSYNTAX: close_curve({{ArgTypeString}} objectlabel, {{ArgTypeString}} close_state)====
EXAMPLE: ''Example: spline_fitclose_curve("Poly_1Curve_1",1)''
DescriptionDESCRIPTION: Applies spline fit transformation on Sets the open/close state of a specified polymesh, polyline or polystrip objectNURBS curve. Use 0 for open curve and 1 for close curve.
====fill_curve({{ArgTypeString}} object)polygonize====
''ExampleSYNTAX: fill_curvepolygonize("Curve_1"{{ArgTypeString}} object, {{ArgTypeAny}} side_length)''
DescriptionEXAMPLE: Fill the interior of the specified closed curve object.''polygonize("Cric_1",2)''
====merge_curve({{ArgTypeString}} object_1, {{ArgTypeString}} object_2)====DESCRIPTION: Polygonizes the specified surface or curve object by the specified side length. The results is a polystrip or a polyline.
''Example: merge_curve("Curve_1","Curve_2")''====polymesh====
DescriptionSYNTAX: Merges two specified curve objects into a single curve.polymesh({{ArgTypeString}} label, {{ArgTypeString}} object, {{ArgTypeAny}} edge_length)
====close_curveEXAMPLE: ''polymesh({{ArgTypeString}} label"Poly_1", {{ArgTypeString}} close_state"Cric_1",2)====''
''ExampleDESCRIPTION: close_curve("Curve_1",1)''Discretizes the specified solid or surface object by the specified edge length. The results is a polymesh object.
Description: Sets the open/close state of a polyline or NURBS curve. Use 0 for open curve and 1 for close curve.====fillet====
====polygonizefillet({{ArgTypeString}} object, {{ArgTypeAny}} side_lengthradius)====
EXAMPLE: ''Example: polygonizefillet("Cric_1Rect_1",25)''
DescriptionDESCRIPTION: Polygonizes Fillets the corners of the specified surface or curve object by the specified side length. The results is a polystrip or a polylineradius.
====polymesh({{ArgTypeString}} label, {{ArgTypeString}} object, {{ArgTypeAny}} edge_length)slice====
''ExampleSYNTAX: polymeshslice("Poly_1"{{ArgTypeString}} object,"Cric_1"{{ArgTypeAny}} x0,2{{ArgTypeAny}} y0, {{ArgTypeAny}} z0, {{ArgTypeAny}} uX, {{ArgTypeAny}} uY, {{ArgTypeAny}} uZ)''
DescriptionEXAMPLE: Discretizes the specified solid or surface object by the specified edge length. The results is a polymesh object.''slice("Rect_1",5)''
====fillet({{ArgTypeString}} DESCRIPTION: Slices the specified object, {{ArgTypeAny}} radius)====into two parts using the specified plane given by the point coordinates and normal vector coordinates.
''Example: fillet("Rect_1",5)''====roughen====
DescriptionSYNTAX: Fillets the corners of the specified surface or curve roughen({{ArgTypeString}} label, {{ArgTypeString}} object by the specified radius., {{ArgTypeAny}} rms_height, {{ArgTypeAny}} correl_length)
====sliceEXAMPLE: ''roughen({{ArgTypeString}} object"Rect_1", {{ArgTypeAny}} x01, {{ArgTypeAny}} y0, {{ArgTypeAny}} z0, {{ArgTypeAny}} uX, {{ArgTypeAny}} uY, {{ArgTypeAny}} uZ5)====''
''ExampleDESCRIPTION: fillet("Rect_1",5)''Roughens the surface of the specified object based on the specified RMS height and correlation length.
Description: Slices the specified object into two parts using the specified plane given by the point coordinates and normal vector coordinates.====random_group====
====roughenSYNTAX: random_group({{ArgTypeString}} label, {{ArgTypeString}} objectkey_object, {{ArgTypeAnyArgTypeString}} rms_heightcontainer_object, {{ArgTypeAny}} correl_lengthelement_count)====
EXAMPLE: ''Example: roughenrandom_group("Rand_1","Rect_1",1"Box_1",5100)''
DescriptionDESCRIPTION: Roughens the surface of Creates a random group using the specified key object based on and confines them in the specified RMS height and correlation lengthcontainer object.
====random_group({{ArgTypeString}} label, {{ArgTypeString}} key_object, {{ArgTypeString}} container_object, {{ArgTypeAny}} element_count)strip_sweep====
''ExampleSYNTAX: random_groupstrip_sweep("Rand_1"{{ArgTypeString}} object,"Rect_1","Box_1",100{{ArgTypeAny}} width)''
DescriptionEXAMPLE: Creates a random group using the specified key object and confines them in the specified container object.''strip_sweep("Curve_1",5)''
====strip_sweep({{ArgTypeString}} DESCRIPTION: Creates a strip version of a given curve object, {{ArgTypeAny}} width)====.
''Example: strip_sweep("Curve_1",5)''====pipe_sweep====
DescriptionSYNTAX: Creates a strip version of a given curve pipe_sweep({{ArgTypeString}} object., {{ArgTypeAny}} radius)
====EXAMPLE: ''pipe_sweep({{ArgTypeString}} object"Curve_1", {{ArgTypeAny}} radius5)====''
''ExampleDESCRIPTION: pipe_sweep("Curve_1",5)''Creates a pipe version of a given curve object.
Description: Creates a pipe version of a given curve object.====rail_sweep====
====SYNTAX: rail_sweep({{ArgTypeString}} rail_object, {{ArgTypeString}} sweep_object)====
EXAMPLE: ''Example: rail_sweep("Curve_1","Curve_2")''
DescriptionDESCRIPTION: Rail-sweeps the specified sweep object along the specified curve object.
== EM.Cube's Python Functions for Material or Object Group Creation ==
28,333
edits