Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

99 linhas
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. CmdVar("vec2", ["X/Y/Z as float", " f f", "(f f)", "(f)"]);
  13. //-------------------------------------------------------------------------
  14. //Mesh CSG operations
  15. //-------------------------------------------------------------------------
  16. CmdType(["csgu", "csgunion"], "Performs a Union operation as :\n(current_scope_outside + new_scope_Outside)", [CmdArg("[ ]", "New scope")]);
  17. CmdType(["csgs", "csgsubstract"], "Performs a Substract operation as :\n(current_scope_Outside + new_scope_Inside-inverted)", [CmdArg("[ ]", "New scope")]);
  18. CmdType(["csgsl", "csgsubstractloss"], "Performs a Substract operation without keeping the new_scope part", [CmdArg("[ ]", "New scope")]);
  19. CmdType(["csga", "csgand"], "Performs an And operation as :\n(current_scope_Inside + new_scope__Inside)", [CmdArg("[ ]", "New scope")]);
  20. CmdType(["csgx", "csgxor"], "Performs a Xor operation as :\n(current_scope_Outside + current_scope_Inside-inverted + new_scope_Outside + new_scope_Inside-inverted)", [CmdArg("[ ]", "New scope")]);
  21. //-------------------------------------------------------------------------
  22. //Mesh Base operations
  23. //-------------------------------------------------------------------------
  24. CmdType(["tsw", "tglscalewind"], "When active, on negative-scaling,\nnormal-vector correction will not occur\nDefault : Inactive");
  25. CmdType(["tqw", "tglquadweight"], "When active, quad will have a fifth center vertex\nDefault : Inactive");
  26. CmdType(["sc", "setcolor"], "Set A & B color", [CmdArg("color", "color")]);
  27. CmdType(["sca", "setcolora"], "Set A color", [CmdArg("color", "color")]);
  28. CmdType(["scb", "setcolorb"], "Set B color", [CmdArg("color", "color")]);
  29. CmdType(["scv", "setcolorv"], "Set the color of all vertices in this scope", [CmdArg("color", "color")]);
  30. CmdType(["lp", "loop"], "Performs a loop with the code in the braces.\nDoesn't open a new scope.", [CmdArg("int", "loopnb"), CmdArg("[ ]", "Loop command")]);
  31. //-------------------------------------------------------------------------
  32. //Mesh transform operations
  33. //-------------------------------------------------------------------------
  34. CmdType(["tx", "translatex"], "Translate vertices along the X axis", [CmdArg("float", "n")]);
  35. CmdType(["ty", "translatey"], "Translate vertices along the Y axis", [CmdArg("float", "n")]);
  36. CmdType(["tz", "translatez"], "Translate vertices along the Z axis", [CmdArg("float", "n")]);
  37. CmdType(["t", "translate"], "Translate vertices", [CmdArg("vec3", "v")]);
  38. CmdType(["rx", "rotatex"], "Rotate vertices along the X axis", [CmdArg("float", "degree")]);
  39. CmdType(["ry", "rotatey"], "Rotate vertices along the Y axis", [CmdArg("float", "degree")]);
  40. CmdType(["rz", "rotatez"], "Rotate vertices along the Z axis", [CmdArg("float", "degree")]);
  41. CmdType(["r", "rotate"], "Rotate vertices along the given axis", [CmdArg("float", "degree"), CmdArg("vec3", "axis")]);
  42. CmdType(["rj", "radialjitter"], "Randomly move vertices along Origin-to-vertex as f(vtx) = vtx + o2v * (1.0 + rand(r))", [CmdArg("float", "r")]);
  43. 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")]);
  44. 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")]);
  45. 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")]);
  46. 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")]);
  47. 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")]);
  48. 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")]);
  49. 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")]);
  50. 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")]);
  51. 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")]);
  52. 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")]);
  53. 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")]);
  54. 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")]);
  55. 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")]);
  56. 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")]);
  57. 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")]);
  58. 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")]);
  59. 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")]);
  60. 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")]);
  61. CmdType(["sx", "scalex"], "Scale vertices", [CmdArg("vec3", "s")]);
  62. CmdType(["sy", "scaley"], "Scale vertices", [CmdArg("vec3", "s")]);
  63. CmdType(["sz", "scalez"], "Scale vertices", [CmdArg("vec3", "s")]);
  64. CmdType(["s", "scale"], "Uniformly Scale vertices", [CmdArg("float", "s")]);
  65. CmdType(["dup", "duplicate"], "Duplicate scope mesh and apply commands in the brackets.", [CmdArg("[ ]", "")]);
  66. CmdType(["mx", "mirrorx"], "Mirror vertices through X-plane");
  67. CmdType(["my", "mirrory"], "Mirror vertices through Y-plane");
  68. CmdType(["mz", "mirrorz"], "Mirror vertices through Z-plane");
  69. CmdType(["ch", "chamfer"], "DOES NOT WORK: Performs a chamfer operation", [CmdArg("float", "f")]);
  70. CmdType(["splt", "splittriangle"], "split triangles in 4 smaller ones", [CmdArg("int", "pass")]);
  71. CmdType(["smth", "smooth"], "Smooth the mesh by subdivising it", [CmdArg("int", "pass"), CmdArg("int", "split_per_pass"), CmdArg("int", "smooth_per_pass")]);
  72. //-------------------------------------------------------------------------
  73. //Mesh shape operations
  74. //-------------------------------------------------------------------------
  75. 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)]",
  76. [CmdArg("int", "nsides"), CmdArg("float", "h"), CmdArg("float", "d1"), CmdArg("float", "d2", "d1"),
  77. CmdArg("bool", "dualsides", "false"), CmdArg("bool", "smooth", "false"), CmdArg("bool", "close", "false")]);
  78. CmdType(["asph", "addsphere"], "Sphere centered on (0,0,0) with BBox:\nMin: [-.5 * d]\nMax: [ .5 * d]", [CmdArg("int", "ndivisions"), CmdArg("float", "d")]);
  79. 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")]);
  80. 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")]);
  81. 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")]);
  82. CmdType(["ascb", "addsmoothchamfbox"], "Box centered on (0,0,0) with BBox:\nMin: [-.5 * size]\nMax: [ .5 * size]", [CmdArg("vec3", "size"), CmdArg("float", "chamf")]);
  83. CmdType(["afcb", "addflatchamfbox"], "Box centered on (0,0,0) with BBox:\nMin: [-.5 * size]\nMax: [ .5 * size]", [CmdArg("vec3", "size"), CmdArg("float", "chamf")]);
  84. CmdType(["as", "addstar"], "Append a Star centered on (0,0,0)\nContained in a disc of max(d1, d2) diameter.",
  85. [CmdArg("int", "nbranches"), CmdArg("float", "d1"), CmdArg("float", "d2"),
  86. CmdArg("bool", "fade", "false"), CmdArg("bool", "fade2", "false")]);
  87. 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.",
  88. [CmdArg("int", "nbranches"), CmdArg("float", "d1"), CmdArg("float", "d2"), CmdArg("float", "extrad", "0.0")]);
  89. CmdType(["ad", "adddisc"], "Disc centered on (0,0,0) with d diameter.", [CmdArg("int", "nsides"), CmdArg("float", "d"), CmdArg("bool", "fade", "false")]);
  90. CmdType(["at", "addtriangle"], "Triangle centered on (0,0,0)\nContained in a disc of d diameter.", [CmdArg("float", "d"), CmdArg("bool", "fade", "false")]);
  91. 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")]);
  92. 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)]",
  93. [CmdArg("float", "h"), CmdArg("vec2", "d10d20"), CmdArg("vec2", "d11d21"), CmdArg("vec2", "d12d22"),
  94. CmdArg("float", "sidemul", "0.0"), CmdArg("bool", "offset", "false")]);