Interface: ProCutter

NEW in 3ds Max 9: The ProCutter Compound Object is part of the ProBoolean Extension. It can be used to cut one or more stock objects using a cutter object:

Methods:

ProCutter.CreateCutter #( <object_1> { , <objectr_2> } ) <addMethod> <stockOutsideCutter> <stockInsideCutter> <cutterOutsideStock> <autoExtractMesh> <explodeByElements>

Creates a ProCutter object using node <operand_1> and multiple nodes
<operand_2>
, all stored in an array.

#( <object_1> { , <object_2> } ) - Specifies the objects used to build the Cutter. Note that the cutter will take over the node and name from <object_1>. The object of the first node will become the first cutter sub-object.

<addMethod> specifies how the <operand_2> node(s) will be used. Possible values are: 1 - instance, operand is an instance of the original node

2 - reference, operand is a reference to original node

3 - copy, operand is a copy of original node

4 - move, original node should be deleted

One of the following three options must be set to true:

<stockOutsideCutter> specifies what to do with the portions of the Stock or Stocks outside the Cutter.

True - keep Stock outside the Cutter

False - remove Stock outside the Cutter

<stockInsideCutter>  specifies what to do with the portions of the Stock or Stocks inside the Cutter.

True - keep Stock inside the Cutter

False - remove Stock inside the Cutter

<cutterOutsideStock> specifies what to do with the portions of the Cutter outside of the Stock or Stocks.

True - keep Cutter outside of the Stock(s)

False - remove Cutter outside of the Stock(s)

<autoExtractMesh> specifies whether the result of the operation should be maintained in the Cutter compound object or extracted into separate mesh.

True - don't modify the cutter object, just cut the stock mesh and extract it into a new object. Note that once the operation is done, the result is an editable mesh with no sub-objects. This flag is useful if you want to use the cutter like a cookie cutter where you reuse the cutter over and over to make holes in an object.

False - maintain all objects in the Cutter compound object Once the operation is performed the result is a procedural Cutter object with both cutters and stocks as sub-objects that can be edited.

<explodeByElements> specifies whether mesh elements should be separated into individual meshes.

True - creates a separate mesh for each element It is a good way to break apart an object into smaller volumes by setting this flag to true while <autoExtractMesh> along with <stockOutsideCutter> and <stockInsideCutter> are also set to true.

False - create a single mesh with a mesh element for each separate volume.

ProCutter.AddStock <cutter_object> #( <stock_1> { , <stock_2> } ) <addMethod> <matMethod>

Adds one or more stock objects to an existing ProCutter compound object.

<cutter_object> is the original ProCutter node created using ProCutter.CreateCutter()

#( <stock_2> { , <stock_2> } ) - specifies one or more stock nodes in an array of nodes.  Note that even if you have only one stock object, you need to use an array, for example #(stockb).

<mat_method> specifies how the materials of the two operands should be handled. Possible values are:

1 - applies operand material

2 - retains original material

ProCutter.getOperandSel <bool_obj> <integer>

Gets the index of the operand currently selected in the operands list.

ProCutter.setOperandSel <bool_obj> <integer> <boolean>

Sets the index of the operand to be selected in the operands list.

ProCutter.getDisplayResult <bool_obj>

ProCutter.setDisplayResult <bool_obj> <boolean>

These methods get and set whether Results or Operands are displayed. If true, Result is displayed. If false, Operands are displayed.

ProCutter.getShowHiddenOps <bool_obj>

ProCutter.setShowHiddenOps <bool_obj> <boolean>

    these methods get and set whether Results + Hidden Operands are
displayed. If true, Results + Hidden Operands are displayed. If false,
the Results or Operands as specified using ProCutter.SetDisplayResult()
are displayed.

ProCutter.getUpdateMode <bool_obj>

ProCutter.setUpdateMode <bool_obj> <integer>

These methods get and set the Update mode as follows:

0 - Always

1 - When Selected

2 - When Rendering

3 - Manually

ProCutter.getDecimationPercent <bool_obj>

ProCutter.setDecimationPercent <bool_obj> <float>

These methods get and set the decimation percentage that determines the percentage of edges that will be removed from the total set of polygons on this Boolean.

ProCutter.getMakeQuad <bool_obj>

ProCutter.setMakeQuad <bool_obj> <boolean>

These methods get and set whether the operation will change the tessellation of the Boolean from triangles to quadrilaterals

ProCutter.getQuadSizePercent <bool_obj>

ProCutter.setQuadSizePercent <bool_obj> <float>

These methods get and set the percentage of the overall length of the quadrilaterals.

ProCutter.getPlanarEdgeRemoval<bool_obj>

ProCutter.setPlanarEdgeRemoval <bool_obj> <integer>

These methods determine how the polygons on planar faces will be handled:

1 - Removes all extra co-planar edges on a face

2 - Removes only invisible edges on each face

3 - No edge removal

Scripting ProCutter Operations

The ProCutter is a two stage operation for scripting. First you create the cutter then you add stocks to the existing cutter.

Example 1:

Create two boxes to be used in cutter and one box for stock. The resulting cutter object will contain 3 operands.

a = box length:10 height:10 width:10

b = box length:4 height:4 width:15

c = box length:13 height:15 width:10

ProCutter.CreateCutter #(a,b) 1 True False False False False

ProCutter.AddStocks a #(c) 1 1

 

Example 2:

This is the sort of set up to use when you want to break an object apart into separate little volumes.

--- Test 2: Use cutter to break apart volumes of stock

--- into separate little volumes that are extracted

--- into separate meshes.  This is what you might do

--- if you want an object to "explode" into smaller

--- pieces.  Note that after the operation the original

--- cutter object stays around and can be used again.

a = box length:10 height:10 width:10

b = box length:4 height:4 width:15

c = box length:13 height:15 width:10

ProCutter.CreateCutter #(a,b) 1 True True False True True

ProCutter.AddStocks a #(c) 1 1

 

See also

ProBoolean Extension