Skip to content

Instantly share code, notes, and snippets.

@JokerMartini
Created August 1, 2015 20:19
Show Gist options
  • Save JokerMartini/dd34b298b2b183f2a58d to your computer and use it in GitHub Desktop.
Save JokerMartini/dd34b298b2b183f2a58d to your computer and use it in GitHub Desktop.
Maxscript: This function demonstrates how to control a blend between a 'linear curve' - 'round curve' - 'inverted round curve'. This is useful when creating a fillet on an object.
numSteps = 20
height = 15.0 --radius
width = 30.0 --radius
smoothness = .5
delete objects
for i = 0 to numSteps do
(
ang = (180.0 / numSteps) * i
/* Circular Calculations */
xCircular = -1 * width/2.0 * cos(ang) --multiplied by -1 to flip horizontal
yCircular = height * sin(ang)
/* Linear Calculations */
xLinear = 1.0 * i / numSteps * width
yLinear = (asin(sin(ang))/90) * height
posL = [xLinear,yLinear,0]
posC = [xCircular,yCircular,0] + [width/2.0,0,0]
point pos:posC size:1 cross:true box:false wirecolor:green
point pos:posL size:1 cross:true box:false wirecolor:red
/* Blend Calculations */
posB = ((posC - posL)*smoothness) + posL
point pos:posB size:1 cross:true box:true wirecolor:yellow
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment