You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

95 lines
11 KiB

  1. //-------------------------------------------------------------------------
  2. //Command vars operations
  3. //-------------------------------------------------------------------------
  4. CmdVar("[ ]", ["Opens a new scope,\nevery operations between the braces\nwill only be done to the vertices added\nsince the start of this scope."]);
  5. CmdVar("float", ["Fraction value", "0.0"]);
  6. CmdVar("int", ["No decimal value", "0"]);
  7. CmdVar("bool", ["Boolean value", "true/false", "1/0"]);
  8. CmdVar("color", ["Red/Green/Blue/{Alpha}",
  9. "HEXA: #ABC{D}", "      #AABBCC{DD}",
  10. "FLOAT: f f f f", "      (f f f f)", "      (f)"]);
  11. CmdVar("vec3", ["X/Y/Z as float", " f f f", "(f f f)", "(f)"]);
  12. //-------------------------------------------------------------------------
  13. //Mesh CSG operations
  14. //-------------------------------------------------------------------------
  15. CmdType(["csgu", "csgunion"], "Performs a Union operation as (mesh0_Outside + mesh1_Outside)", [CmdArg("[ ]", "")]);
  16. CmdType(["csgs", "csgsubstract"], "Performs a Substract operation as (mesh0_Outside + mesh1_Inside-inverted)", [CmdArg("[ ]", "")]);
  17. CmdType(["csgsl", "csgsubstractloss"], "Performs a Substract operation without keeping the mesh1 part", [CmdArg("[ ]", "")]);
  18. CmdType(["csga", "csgand"], "Performs an And operation as (mesh0_Inside + mesh1_Inside)", [CmdArg("[ ]", "")]);
  19. CmdType(["csgx", "csgxor"], "Performs a Xor operation as (m0_Outside/m0_Inside-inverted + m1_Outside/m1_Inside-inverted)", [CmdArg("[ ]", "")]);
  20. //-------------------------------------------------------------------------
  21. //Mesh Base operations
  22. //-------------------------------------------------------------------------
  23. CmdType(["tsw", "scalewinding"], "When activated, on negative-scaling,\nnormal-vector correction will not occur");
  24. CmdType(["sc", "setcolor"], "Set A color", [CmdArg("color", "color")]);
  25. CmdType(["scb", "setcolorb"], "Set B color", [CmdArg("color", "color")]);
  26. CmdType(["scv", "setcolorv"], "Set the color of all vertices in this scope", [CmdArg("color", "color")]);
  27. //-------------------------------------------------------------------------
  28. //Mesh transform operations
  29. //-------------------------------------------------------------------------
  30. CmdType(["tx", "translatex"], "Translate vertices along the X axis", [CmdArg("float", "n")]);
  31. CmdType(["ty", "translatey"], "Translate vertices along the Y axis", [CmdArg("float", "n")]);
  32. CmdType(["tz", "translatez"], "Translate vertices along the Z axis", [CmdArg("float", "n")]);
  33. CmdType(["t", "translate"], "Translate vertices", [CmdArg("vec3", "v")]);
  34. CmdType(["rx", "rotatex"], "Rotate vertices along the X axis", [CmdArg("float", "degree")]);
  35. CmdType(["ry", "rotatey"], "Rotate vertices along the Y axis", [CmdArg("float", "degree")]);
  36. CmdType(["rz", "rotatez"], "Rotate vertices along the Z axis", [CmdArg("float", "degree")]);
  37. CmdType(["r", "rotate"], "Rotate vertices along the given axis", [CmdArg("float", "degree"), CmdArg("vec3", "axis")]);
  38. CmdType(["rj", "radialjitter"], "Randomly move vertices along Origin-to-vertex as f(vtx) = vtx + o2v * (1.0 + rand(r))", [CmdArg("float", "r")]);
  39. CmdType(["tax", "taperx"], "multiply axis y/z by f(x)\nf(z) = z * (1.0 + (nz * f(x) + xoff))\nf(x) = absolute ? abs_x : x", [CmdArg("float", "ny"), CmdArg("float", "nz"), CmdArg("float", "xoff", "0.0"), CmdArg("bool", "absolute", "true")]);
  40. CmdType(["tay", "tapery"], "multiply axis x/z by f(y)\nf(x) = x * (1.0 + (nx * f(y) + yoff))\nf(y) = absolute ? abs_y : y", [CmdArg("float", "nx"), CmdArg("float", "nz"), CmdArg("float", "yoff", "0.0"), CmdArg("bool", "absolute", "true")]);
  41. CmdType(["taz", "taperz"], "multiply axis x/y by f(z)\nf(y) = y * (1.0 + (ny * f(z) + zoff))\nf(z) = absolute ? abs_z : z", [CmdArg("float", "nx"), CmdArg("float", "ny"), CmdArg("float", "zoff", "0.0"), CmdArg("bool", "absolute", "true")]);
  42. CmdType(["twx", "twistx"], "Twist vertices around x axis with x as rotation value\nf(p) = (RotateX(x * t + toff) * p)", [CmdArg("float", "t"), CmdArg("float", "toff", "0.0")]);
  43. CmdType(["twy", "twisty"], "Twist vertices around y axis with y as rotation value\nf(p) = (RotateY(y * t + toff) * p)", [CmdArg("float", "t"), CmdArg("float", "toff", "0.0")]);
  44. CmdType(["twz", "twistz"], "Twist vertices around z axis with z as rotation value\nf(p) = (RotateZ(z * t + toff) * p)", [CmdArg("float", "t"), CmdArg("float", "toff", "0.0")]);
  45. CmdType(["shx", "shearx"], "Shear vertices using x value as shear quantity\nf(z) = z + (nz * f(x) + xoff)\nf(x) = absolute ? abs_x : x", [CmdArg("float", "ny"), CmdArg("float", "nz"), CmdArg("float", "xoff", "0.0"), CmdArg("bool", "absolute", "true")]);
  46. CmdType(["shy", "sheary"], "Shear vertices using y value as shear quantity\nf(x) = x + (nx * f(y) + yoff)\nf(y) = absolute ? abs_y : y", [CmdArg("float", "nx"), CmdArg("float", "nz"), CmdArg("float", "yoff", "0.0"), CmdArg("bool", "absolute", "true")]);
  47. CmdType(["shz", "shearz"], "Shear vertices using z value as shear quantity\nf(y) = y + (ny * f(z) + zoff)\nf(z) = absolute ? abs_z : z", [CmdArg("float", "nx"), CmdArg("float", "ny"), CmdArg("float", "zoff", "0.0"), CmdArg("bool", "absolute", "true")]);
  48. CmdType(["stx", "stretchx"], "Stretch vertices using x value as stretch quantity\nf(z) = z + (pow(x, nz) + xoff)", [CmdArg("float", "ny"), CmdArg("float", "nz"), CmdArg("float", "xoff", "0.0")]);
  49. CmdType(["sty", "stretchy"], "Stretch vertices using y value as stretch quantity\nf(x) = x + (pow(y, nx) + yoff)", [CmdArg("float", "nx"), CmdArg("float", "nz"), CmdArg("float", "yoff", "0.0")]);
  50. CmdType(["stz", "stretchz"], "Stretch vertices using z value as stretch quantity\nf(y) = y + (pow(z, ny) + zoff)", [CmdArg("float", "nx"), CmdArg("float", "ny"), CmdArg("float", "zoff", "0.0")]);
  51. CmdType(["bdxy", "bendxy"], "Bend vertices using x as bend quantity along y axis\nf(p) = (RotateY(x * t + toff) * p)", [CmdArg("float", "t"), CmdArg("float", "toff", "0.0")]);
  52. CmdType(["bdxz", "bendxz"], "Bend vertices using x as bend quantity along z axis\nf(p) = (RotateZ(x * t + toff) * p)", [CmdArg("float", "t"), CmdArg("float", "toff", "0.0")]);
  53. CmdType(["bdyx", "bendyx"], "Bend vertices using y as bend quantity along x axis\nf(p) = (RotateX(y * t + toff) * p)", [CmdArg("float", "t"), CmdArg("float", "toff", "0.0")]);
  54. CmdType(["bdyz", "bendyz"], "Bend vertices using y as bend quantity along z axis\nf(p) = (RotateZ(y * t + toff) * p)", [CmdArg("float", "t"), CmdArg("float", "toff", "0.0")]);
  55. CmdType(["bdzx", "bendzx"], "Bend vertices using z as bend quantity along x axis\nf(p) = (RotateX(z * t + toff) * p)", [CmdArg("float", "t"), CmdArg("float", "toff", "0.0")]);
  56. CmdType(["bdzy", "bendzy"], "Bend vertices using z as bend quantity along y axis\nf(p) = (RotateY(z * t + toff) * p)", [CmdArg("float", "t"), CmdArg("float", "toff", "0.0")]);
  57. CmdType(["sx", "scalex"], "Scale vertices", [CmdArg("vec3", "s")]);
  58. CmdType(["sy", "scaley"], "Scale vertices", [CmdArg("vec3", "s")]);
  59. CmdType(["sz", "scalez"], "Scale vertices", [CmdArg("vec3", "s")]);
  60. CmdType(["s", "scale"], "Uniformly Scale vertices", [CmdArg("float", "s")]);
  61. CmdType(["dup", "duplicate"], "Duplicate scope mesh and apply commands in the brackets.", [CmdArg("[ ]", "")]);
  62. CmdType(["mx", "mirrorx"], "Mirror vertices through X-plane");
  63. CmdType(["my", "mirrory"], "Mirror vertices through Y-plane");
  64. CmdType(["mz", "mirrorz"], "Mirror vertices through Z-plane");
  65. CmdType(["ch", "chamfer"], "DOES NOT WORK: Performs a chamfer operation", [CmdArg("float", "f")]);
  66. CmdType(["splt", "splittriangle"], "split triangles in 4 smaller ones", [CmdArg("int", "pass")]);
  67. CmdType(["smth", "smooth"], "Smooth the mesh by subdivising it", [CmdArg("int", "pass"), CmdArg("int", "split_per_pass"), CmdArg("int", "smooth_per_pass")]);
  68. //-------------------------------------------------------------------------
  69. //Mesh shape operations
  70. //-------------------------------------------------------------------------
  71. CmdType(["ac", "addcylinder"], "Cylinder centered on (0,0,0) with BBox:\nMin: [-.5 * max(d1, d2),-.5 * h,-.5 * max(d1, d2)]\nMax: [ .5 * max(d1, d2), .5 * h, .5 * max(d1, d2)]",
  72. [CmdArg("int", "nsides"), CmdArg("float", "h"), CmdArg("float", "d1"), CmdArg("float", "d2"),
  73. CmdArg("bool", "dualsides", "false"), CmdArg("bool", "smooth", "false"), CmdArg("bool", "close", "false")]);
  74. CmdType(["asph", "addsphere"], "Sphere centered on (0,0,0) with BBox:\nMin: [-.5 * d]\nMax: [ .5 * d]", [CmdArg("int", "ndivisions"), CmdArg("float", "d")]);
  75. CmdType(["acap", "addcapsule"], "Capsule centered on (0,0,0) with BBox:\nMin: [-.5 * d,-(.5 * d + h),-.5 * d]\nMax: [ .5 * d, (.5 * d + h), .5 * d]", [CmdArg("int", "ndivisions"), CmdArg("float", "h"), CmdArg("float", "d")]);
  76. CmdType(["ato", "addtorus"], "Torus centered on (0,0,0) with BBox:\nMax: [-.5 * d2]\nMax: [ .5 * d2]", [CmdArg("int", "ndivisions"), CmdArg("float", "d1"), CmdArg("float", "d2")]);
  77. CmdType(["ab", "addbox"], "Box centered on (0,0,0) with BBox:\nMin: [-.5 * size]\nMax: [ .5 * size]", [CmdArg("vec3", "size"), CmdArg("float", "chamf", "0.0")]);
  78. CmdType(["ascb", "addsmoothchamfbox"], "Box centered on (0,0,0) with BBox:\nMin: [-.5 * size]\nMax: [ .5 * size]", [CmdArg("vec3", "size"), CmdArg("float", "chamf")]);
  79. CmdType(["afcb", "addflatchamfbox"], "Box centered on (0,0,0) with BBox:\nMin: [-.5 * size]\nMax: [ .5 * size]", [CmdArg("vec3", "size"), CmdArg("float", "chamf")]);
  80. CmdType(["as", "addstar"], "Append a Star centered on (0,0,0)\nContained in a disc of max(d1, d2) diameter.",
  81. [CmdArg("int", "nbranches"), CmdArg("float", "d1"), CmdArg("float", "d2"),
  82. CmdArg("bool", "fade", "false"), CmdArg("bool", "fade2", "false")]);
  83. CmdType(["aes", "addexpandedstar"], "Star centered on (0,0,0)\nContained in a disc of max(max(d1, d2), max(d1 + extrad, d2 + extrad)) diameter.\nExpanded star branches use Color2.",
  84. [CmdArg("int", "nbranches"), CmdArg("float", "d1"), CmdArg("float", "d2"), CmdArg("float", "extrad", "0.0")]);
  85. CmdType(["ad", "adddisc"], "Disc centered on (0,0,0) with d diameter.", [CmdArg("int", "nsides"), CmdArg("float", "d"), CmdArg("bool", "fade", "false")]);
  86. CmdType(["at", "addtriangle"], "Triangle centered on (0,0,0)\nContained in a disc of d diameter.", [CmdArg("float", "d"), CmdArg("bool", "fade", "false")]);
  87. CmdType(["aq", "addquad"], "Quad centered on (0,0,0) with BBox:\nMin: [-size * .5f, 0,-size * .5f]\nMax: [ size * .5f, 0, size * .5f]", [CmdArg("float", "size"), CmdArg("bool", "fade", "false")]);
  88. CmdType(["acg", "addcog"], "Gear centered on (0,0,0) with BBox:\nMin: [-.5 * max(d1, d2),-.5 * h,-.5 * max(d1, d2)]\nMax: [ .5 * max(d1, d2), .5 * h, .5 * max(d1, d2)]",
  89. [CmdArg("float", "h"), CmdArg("float", "d10"), CmdArg("float", "d20"), CmdArg("float", "d1"), CmdArg("float", "d2"), CmdArg("float", "d12"), CmdArg("float", "d22"),
  90. CmdArg("float", "sidemul", "1.0"), CmdArg("bool", "offset", "false")]);