mcjBuilterA Tutorial 1


Introduction

This tutorial  explains mcjBuilderA extrusion-path-script writing   

To describe mesh creation, we use the analogy of "extrusion"

some solid material is pushed through an imaginary hole/nozzle

The shape of this nozzle is referred to as the "extrusion profile" or "molding shape"


In mcjBuilderA's "Settings for molding profile" panel, you can select a molding profile using the drop-down-list Labeled "Profile"

The chosen profile in our example is named "f"

The mold Width is 100 cm and the mold Height is 100 cm,

The red cross shown in the "blackboard" panel indicates the origin [0,0] of the shape

the extrusion path will pass through this point.


mcjBuilderA suggests we use a height of 167cm if we intend to keep the original proportions


the initial position of the nozzle in the scene is ( 0, 0, 0 )

the initial rotations of the nozzle are ( 0°, 0°, 0° )

the nozzle's plane is standing up ( like the green arrow Y axis )

and facing the Z axis  ( blue arrow )

If the path-extrusion script started with a "Move 1" command

which means "move forth 1 step" then

the extrusion nozzle would advance along the Z axis ( blue arrow ) by 1 step



in mcjBuilderA's "Settings for extrusion path" panel. the "Tread" parameter was set to 100 cm, 

so the command "Move 1" resulted in a 100cm long extrusion.

the term "tread" comes from the stair design terminology" because mcjBuilderA started as a stair handrail builder script

---


"ring" and "move: making straight tubes


lets look at the extrusion path script

     
  MoveY 0.835

Ring

Move 1

Ring

 
     

Y ( green arrow ) is the up axis

so "Move Y 0.855" means move the nozzle up by 0.835 step

since Tread is 100 cm, it meant move the nozzle up 83.5 cm

remember we made the profile  167 cm tall earlier

half of the nozzle was initially below ground level, it's now entirely above ground

Ring This creates the first ring of vertices of the molding!

Move 1 Moves the nozzle forth 1 x 100 cm

Ring This creates the second ring of vertices of the molding, so we now have a molding segment



The "Paste Settings" button : Saving everything


in the previous example, we did set the mold width and mold height 

But lets say, one month from now we want to build our F shape again

nothing tells us what the values for mold width and mold height will be

and maybe we wont even remember what values we used 

So we will make all the settings part of the script

     
 

Profile f

MoldSize 100 167

ProfileUnits cm

ProfileMirrorX off

ProfileMirrorY off

CloseProfile on

PathUnits cm

Tread 100

Slope 0

Radius 1

ClosePath on

WeldUVs off

StepAngle 11.25

InvertNormals off

InvertUVu off

 
     

starting with version Beta 6 there is a button labeled "paste settings" which

will paste all the current settings in your script box



"define: defining something for easy re-use


using the define command you can give a name to a block of commands

along with the name of the defined block, you can supply a list of parameters

in the example below, we give the name "segment" to a block of 3 commands

and we state that it will be accompanied with 1 parameter named "d"

note how we then use "d" in the "move" command

the command "defineEnd" signals the end of the block

     
  define segment d

Ring

Move d

Ring

defineEnd

segment    4 
 
     

so from now on, we simply type


segment    4


and we'll get a segment of length 4




break : break it into pieces


issuing the break command ... breaks the extrusion path

you can then move the nozzle elsewhere and make a new tube

     
  MoveY .835


define segment d

Ring

Move d

Ring

defineEnd


segment 2

break

Move 1

segment 3

 
     

so here we 

  • create a tube segment, of length 2, 
  • break it, 
  • move 1 step away, 
  • create another segment of length 3
 
love



"material" : one material a piece


now that we know how to break a path into multiple objects we may want to give each piece a different material

when you dont use the "material" command, everything in your molding uses the material named "default

     
  define segment d

Ring

Move d

Ring

defineEnd


Material matA

segment 2

break

Material matB

Move 1

segment 3

 
     




Comments