Changes

Glossary of EM.Cube's Python Functions

304 bytes added, 23:57, 17 September 2016
/* EM.Cube's Python Functions for Geometric Object Transformation */
== EM.Cube's Python Functions for Geometric Object Transformation ==
====freeze==== freeze({{ArgTypeString}} object, {{ArgTypeReal}} freeze_state)====
''Example: freeze("MyObj",1)''
Description: Sets the freeze state of an object (0/1).
====move_to==== move_to({{ArgTypeString}} object, {{ArgTypeString}} group_node_label[, {{ArgTypeString}} module_name])====
''Example: move_to("NewObj","MyObj",10,10,0)''
Description: 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==== clone({{ArgTypeString}} label, {{ArgTypeString}} object, {{ArgTypeReal}} x0, {{ArgTypeReal}} y0, {{ArgTypeReal}} z0)====
''Example: clone("NewObj","MyObj",10,10,0)''
Description: Creates a copy of the specified object and repositions it at the given coordinates.
====translate_by==== translate_by({{ArgTypeString}} object, {{ArgTypeReal}} x_dist, {{ArgTypeReal}} y_dist, {{ArgTypeReal}} z_dist)====
''Example: translate_by("MyObj",10,10,x)''
Description: Translates an object by the specified distances in each direction.
====translate_to====  translate_to({{ArgTypeString}} object, {{ArgTypeReal}} x_dest, {{ArgTypeReal}} y_dest, {{ArgTypeReal}} z_dest)====
''Example: translate_to("MyObj",20,20,x2)''
Description: Translates an object to the specified destination.
====rotate==== rotate({{ArgTypeString}} object, {{ArgTypeAny}} rot_angle_degree, {{ArgTypeAny}} rot_axis_x, {{ArgTypeAny}} rot_axis_y, {{ArgTypeAny}} rot_axis_z)====
''Example: rotate("pyramid_1",45,1,1,0)''
Description: 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==== scale({{ArgTypeString}} object, {{ArgTypeAny}} scale_factor)====
''Example: scale("pyramid_1",2)''
Description: Scales an object by the specified scale factor.
====get_length==== get_length({{ArgTypeString}} object)====
''Example: get_length("helix_1")''
Description: Returns the length of a curve object.
====get_area==== get_area({{ArgTypeString}} object)====
''Example: get_area("ellipse_1")''
Description: Returns the area of a surface object or the total surface area of a solid object.
====get_volume==== get_volume({{ArgTypeString}} object)====
''Example: get_volume("pyramid_1")''
Description: Returns the volume of a solid object.
====get_lcs==== get_lcs({{ArgTypeString}} object, {{ArgTypeString}} coordinate)====
''Example: get_lcs("pyramid_1","x")''
Description: Returns the specified coordinate of the LCS of an object.
====get_rot==== get_rot({{ArgTypeString}} object, {{ArgTypeString}} coordinate)====
''Example: get_rot("pyramid_1","x")''
Description: Returns the specified rotation angle of an object.
====get_axis==== get_axis({{ArgTypeString}} object, {{ArgTypeString}} axis, {{ArgTypeString}} coordinate)====
''Example: get_axis("pyramid_1","x","y")''
Description: Returns the specified coordinate of the unit vector along the specified local axis of an object.
====get_lcs_offset==== get_lcs_offset({{ArgTypeString}} object, {{ArgTypeAny}} x_off, {{ArgTypeAny}} y_off, {{ArgTypeAny}} z_off, {{ArgTypeString}} coordinate)====
''Example: get_lcs_offset("box_1",50,50,0,"x")''
Description: 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==== get_extent({{ArgTypeString}} object, {{ArgTypeString}} coordinate)====
''Example: get_extent("pyramid_1","x")''
Description: Returns the size of the bounding box of an object along the specified direction.
====get_vertex==== get_vertex({{ArgTypeString}} object, {{ArgTypeAny}} node_index, {{ArgTypeString}} coordinate)====
''Example: get_vertex("pyramid_1",0,"x")''
Description: 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==== set_rot({{ArgTypeString}} object, {{ArgTypeAny}} rot_x, {{ArgTypeAny}} rot_y, {{ArgTypeAny}} rot_z)====
''Example: set_rot("pyramid_1",0,0,45)''
Description: Sets the three rotation angles of an object.
====set_lcs_link==== set_lcs_link({{ArgTypeString}} object, {{ArgTypeString}} lcs_obj, {{ArgTypeAny}} x_off, {{ArgTypeAny}} y_off, {{ArgTypeAny}} z_off)====
''Example: set_lcs_link("pyramid_1","box_1",50,50,0)''
Description: 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==== set_rot_link({{ArgTypeString}} object, {{ArgTypeString}} lcs_obj, {{ArgTypeAny}} x_off_deg, {{ArgTypeAny}} y_off_deg, {{ArgTypeAny}} z_off_deg)====
''Example: set_rot_link("pyramid_1","box_1",0,0,45)''
Description: 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==== mirror({{ArgTypeString}} object, {{ArgTypeAny}} x0, {{ArgTypeAny}} y0, {{ArgTypeAny}} z0, {{ArgTypeAny}} uX, {{ArgTypeAny}} uY, {{ArgTypeAny}} uZ)====
''Example: mirror("pyramid_1",0,0,0,1,0,0)''
Description: Mirrors an object in a plane defined by the specified point coordinates and specified normal vector components.
====group==== group({{ArgTypeString}} label, {{ArgTypeString}} object_1, {{ArgTypeString}} object_2, ...)====
''Example: group("Composite_1","Box_1","Box_2","Box_3")''
Description: Groups a number of objects into a composite object with the given label.
====array==== array({{ArgTypeString}} label, {{ArgTypeString}} object, {{ArgTypeAny}} x_count, {{ArgTypeAny}} y_count, {{ArgTypeAny}} z_count, {{ArgTypeAny}} x_spacing, {{ArgTypeAny}} y_spacing, {{ArgTypeAny}} z_spacing)====
''Example: array("Array_1","Rect_Strip_1",4,4,1,50,50,0)''
Description: Creates or modifies an array object.
====array_custom==== 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: array_custom("Array_1","Rect_Strip_1",4,4,1,50,50,0,100,100,20,0,0,45)''
Description: Creates or modifies an array object and sets its local coordinate system and rotation angles.
====explode==== explode({{ArgTypeString}} object)====
''Example: explode("MyArray")''
Description: Explodes an object into its basic primitives.
====subtract==== subtract({{ArgTypeString}} label, {{ArgTypeString}} object_1, {{ArgTypeString}} object_2)====
''Example: subtract("Subtract_Object","Rect_Strip1","Rect_Strip2")''
Description: 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==== union({{ArgTypeString}} label, {{ArgTypeString}} object_1, {{ArgTypeString}} object_2)====
''Example: union("Union_Object","Rect_Strip1","Rect_Strip2")''
Description: 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==== intersect({{ArgTypeString}} label, {{ArgTypeString}} object_1, {{ArgTypeString}} object_2)====
''Example: intersect("Intersection_Object","Rect_Strip1","Rect_Strip2")''
Description: 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==== extrude({{ArgTypeString}} label, {{ArgTypeString}} object, {{ArgTypeAny}} extrude_height, {{ArgTypeAny}} cap_ends)====
''Example:extrude("Extrude_1","Rect_Strip1",50)''
Description: 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==== loft({{ArgTypeString}} label, {{ArgTypeString}} object, {{ArgTypeAny}} loft_height, {{ArgTypeAny}} cap_base)====
''Example: loft("Loft_1","Rect_Strip1",50)''
Description: 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==== 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)''
28,333
edits