Architecture /
Research |
August 28, 2006 « Cutting Polygon Faces »

Here is a MEL script I wrote that automates polygon face cutting. Its pretty self explanatory if you’re into this kind of thing.
//global variables
$Name = “myBuilding”;
//cylinder variables
$radius = 25;
$sections = 16;
$cheight = 110;
//cutting variables
$level = 15;
$height = 100;
$anglePos = 60;
$angleNeg = 0;
$extra = 2;
$slabThickness = .5;
//make cylinder
polyCylinder -r $radius -h $cheight -sx $sections -sy 1 -sz 1 -ax 0 0 1 -tx 1 -ch 1;
rename “pCylinder1” $Name;
move 0 0 ($height/2);
//cut faces
$i = 0;
//loop while $i is less than number of floors
while($i < ($height/$level) + $extra){
//slabs
polyCut -ws 1 -pcx 0 -pcy 0 -pcz (($i * $level)+$slabThickness) -rx 0 -ry $angleNeg -rz 90 -pw 1 -ph 1 -ch 1 $Name;
polyCut -ws 1 -pcx 0 -pcy 0 -pcz ($i * $level) -rx 0 -ry $angleNeg -rz 90 -pw 1 -ph 1 -ch 1 $Name;
//diagonals
polyCut -ws 1 -pcx 0 -pcy 0 -pcz ($i * $level) -rx 0 -ry $anglePos -rz 90 -pw 1 -ph 1 -ch 1 $Name;
polyCut -ws 1 -pcx 0 -pcy 0 -pcz ($i * $level) -rx 0 -ry ($anglePos * -1) -rz 90 -pw 1 -ph 1 -ch 1 $Name;
$i++;
}





























