d3object library
d3object.cube( { x, y, z }, true/false );- first parameter
tabletype- The length, width and height of the cube.
- second parameter
booleantype- true The cube is at the center of (0, 0, 0). If the position of the
3d objectof the object is specified throughtransform.postion, then it is at the center of this point. - false (default) The base of the cube (the first quadrant of the xoy plane (0, 0)) has one corner at (0, 0, 0). If the position of the
3d objectof the object is specified throughtransform.postion, then This point on the bottom corner of it.
- true The cube is at the center of (0, 0, 0). If the position of the
cube1 = d3object.cube({10, 10, 10}, true);
-- or
cube2 = d3object.cube({20, 20, 20}, false);d3object library
d3object.cylinder({ h = number, r = number, r1 = number, r2 = number, d = number, d1 = number, d2 = number }, true/false );- h
numbertype- Specify the height of the cylinder
- r
numbertype- Specifies the radius of the cylinder. If the parameter
ris entered, the parametersr1, r2, d1, d2are no longer accepted.
- Specifies the radius of the cylinder. If the parameter
- d
numbertype- Specifies the diameter of the cylinder. If the parameter
dis entered, the parametersr1, r2, d1, d2are no longer accepted.
- Specifies the diameter of the cylinder. If the parameter
- r1
numbertype- Specifies the top radius of the cylinder. How to input parameter
r1, it will continue to readr2, and no longer accept parametersr, d, d1, d2.
- Specifies the top radius of the cylinder. How to input parameter
- r2
numbertype- Specifies the base radius of the cylinder. If parameter
r2is entered, parametersr, d, d1, d2are no longer accepted.
- Specifies the base radius of the cylinder. If parameter
- d1
numbertype- Specifies the diameter of the top surface of the cylinder. How to input parameter
d1, it will continue to readd2, and no longer accept parametersr, d, r1, r2.
- Specifies the diameter of the top surface of the cylinder. How to input parameter
- d2
numbertype- Specifies the base diameter of the cylinder. How to input parameter
d2, but no longer accept parametersr, d, r1, r2.
- Specifies the base diameter of the cylinder. How to input parameter
- last parameter
booleantype- true The cylinder is centered at (0, 0, 0). If the position of the
3d objectof the object is specified throughtransform.postion, then it is at the center of this point. - false (default) The base of the cylinder (the first quadrant of the xoy plane (0, 0)) has a corner at (0, 0, 0), if the position of the
3d objectof the object is specified throughtransform.postion, Then this is the point on the bottom corner.
- true The cylinder is centered at (0, 0, 0). If the position of the
local cylinder1 = d3object.cylinder({h = 1, r = 10}, true );
-- or
local cylinder2 = d3object.cylinder({h = 1, d = 20}, false );
-- or
local cylinder3 = d3object.cylinder({h = 1, r1 = 10, r2 = 20}, true );
-- or
local cylinder4 = d3object.cylinder({h = 1, d1 = 20, d2 = 40}, false );d3object library
d3object.sphere({r = number, d = number});- r
numbertype- Specifies the radius of the sphere. If
ris entered, the parameterdwill no longer be accepted.
- Specifies the radius of the sphere. If
- d
numbertype- Specifies the diameter of the sphere. If
dis entered, the parameterrwill no longer be received.
- Specifies the diameter of the sphere. If
sphere1 = d3object.sphere({ r = 10 });
-- or
sphere2 = d3object.sphere({ d = 20 });d3object library
d3object.polyhedron({{x1, y1, z1}, {x2, y2, z2}, {x3, y3, z3},.........},
{{index1, index2, index3}, {index1, index3, index4, index2} ............});- first parameter points
tabletype- This table is a two-dimensional array, each
{x, y, z}represents the coordinates of a point.
- This table is a two-dimensional array, each
- The second parameter faces
tabletype- This table is a two-dimensional array. The
indexin each{index1, index2, index3}is the subscript of the point in the previouspointstable. Such atablerepresents the points contained in a surface. gather.
- This table is a two-dimensional array. The
--[[
@description: arg1 points, arg2 faces
@return {*}
--]]
polyhedron1 = d3object.polyhedron({{10, 10, 0}, {10, -10, 0}, {-10, -10, 0}, {-10, 10, 0}}, {{0, 1, 4}, {1, 2, 4}, {2, 3, 4}, {3, 0, 4}, {1, 0, 3}, {2, 1, 3}});