Child pages
  • 3DS Max Contour Tutorial
Skip to end of metadata
Go to start of metadata

See also:

Generative Design

 

Autodesk

 

CAD

Link:

LEARN, The Catalogue 

 

Post a question to Media Centre

Introduction:

Generating contour models can be both time consuming and difficult. The following script for 3DSMax may help with this problem.

Script:

If your intention is to cut evenly spaced sections across your model to produce a contour model on the laser cutter the following MaxScript (which can be found along with more notes in Help > MaxScript reference, ¿Section : Shape¿) may come in useful.

 
meshSelected = sphere() -- object to create contours of
minZ = meshSelected.min.z -- get min and max Z positions
maxZ = meshSelected.max.z
numLevels = 10 -- the number of contours
delta = (maxZ - minZ) / (numLevels + 1) -- the number of steps
for currentZ = minZ to maxZ by delta do -- start loop...
(
s = section pos:[0, 0, currentZ] -- create Section
max views redraw -- this line is needed to get around the problem
convertToSplineShape s -- convert Section to SplineShape
s.renderable = true -- set to renderable
)
This script creates 10 sections from the bottom to top of a created sphere. In order to make it create x sections from top to bottom of your desired mesh change the line
meshSelected = sphere() -- object to create contours of
to
meshSelected = $ -- object to create contours of
the $ symbol represents the currently selected object/s in the scene.
Change
numLevels = 10 -- the number of contours
to the number of sections you require. E.g.
numLevels = 60 -- the number of contours
for 60 sections.
With some consultation of the maxscript reference you may be able to further configure the script to your liking. Here is an example which will lay the generated section shapes out in a grid determined by the variables ¿numX¿, ¿spacingX¿ and ¿spacingY¿:
meshSelected = $ -- object to create contours of

numX = 3 -- number of sections in each row (the X axis)
spacingX = 200 -- the distance between sections in the X axis direction
spacingY = -20 -- the distance between sections in the Y axis direction

posX = 0 -- current column counter
posY = 0 -- current row counter

minZ = meshSelected.min.z -- get min and max Z positions
maxZ = meshSelected.max.z
numLevels = 10 -- the number of contours
delta = (maxZ - minZ) / (numLevels + 1) -- the number of steps
for currentZ = minZ to maxZ by delta do -- start loop...
(
s = section pos:[0, 0, currentZ] -- create Section
max views redraw -- this line is needed to get around the problem
convertToSplineShape s -- convert Section to SplineShape

s.pos = [posX * spacingX, posY * spacingY, 0] -- move section

if posX < numX then
(
     posX +=1
)
else
(
     posX = 0
     posY += 1
)

s.renderable = true -- set to renderable
)


Additional:

 

References:

 

External links:

 

Published:

First published Mon. 1 Feb. 2010

  • No labels