Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lua/primitive/core/construct.lua
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,14 @@ do
either a function or a coroutine that will build the mesh
--]]
function addon.construct.get( name, param, threaded, physics )
if param and param.PrimUNITS == "millimeters" then
if param and param.PrimUNITS == "centimeters" then
param = table.Copy( param )
if isvector( param.PrimSIZE ) then
local s = param.PrimSIZE * 0.03937
local s = param.PrimSIZE * 0.3937
param.PrimSIZE = Vector( math_max( s.x, 1 ), math_max( s.y, 1 ), math_max( s.z, 1 ) )
end
if isnumber( param.PrimDT ) then param.PrimDT = math_max( param.PrimDT * 0.03937, 1 ) end
if isnumber( param.PrimSLANT ) then param.PrimSLANT = param.PrimSLANT * 0.03937 end
if isnumber( param.PrimDT ) then param.PrimDT = math_max( param.PrimDT * 0.3937, 1 ) end
if isnumber( param.PrimSLANT ) then param.PrimSLANT = param.PrimSLANT * 0.3937 end
end
return addon.construct.generate( construct_types[name], param, threaded, physics )
end
Expand Down
2 changes: 1 addition & 1 deletion lua/primitive/entities/shapes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ do
local class = {}

local typen = { "cone", "cube", "cube_magic", "cube_hole", "cylinder", "dome", "dome_hollow", "parallelogram", "plane", "pyramid", "sphere", "torus", "tube", "wedge", "wedge_corner" }
local typek, unitk, defaults = {}, { source = "source", millimeters = "millimeters" }, {}
local typek, unitk, defaults = {}, { source = "source", centimeters = "centimeters" }, {}

do
for k, v in pairs( typen ) do
Expand Down