【发布时间】:2016-01-21 12:32:57
【问题描述】:
我是 openscad 的新手,正在尝试从 dxf 文件制作 3d 模型。我想将其大小指定为 130x130。我已经能够达到下面的代码,但它仍然没有断言我想要的大小:
linear_extrude(height = 5, center = true, convexity = 10) import (file="bahtinov.dxf");
感谢任何帮助!
【问题讨论】:
标签: openscad
我是 openscad 的新手,正在尝试从 dxf 文件制作 3d 模型。我想将其大小指定为 130x130。我已经能够达到下面的代码,但它仍然没有断言我想要的大小:
linear_extrude(height = 5, center = true, convexity = 10) import (file="bahtinov.dxf");
感谢任何帮助!
【问题讨论】:
标签: openscad
您可以使用dxf_dim():在您的 dxf 中再创建一层,例如"dimensions",用最大值画一条水平和垂直的尺寸线。宽度分别最大。 Documentation 中描述的高度,作为标识符,例如“TotalWidth”和“TotalHeight”,这里以我的测试图为例:
通过以下方式获取值:
tw = dxf_dim(file="bahtinov.dxf", name="TotalWidth", layer="dimensions", scale=1);
th = dxf_dim(file="bahtinov.dxf", name="TotalHeight", layer="dimensions", scale=1);
缩放部分:
scale([130/tw,130/th,1]) linear_extrude(height = 5, center = true) import(file="bahtinov.dxf", layer="layerName", scale=1);
【讨论】:
您可以通过在导入的 DXF 上使用 resize() 来实现:
linear_extrude(height = 5, center = true, convexity = 10) resize([130,130]) import (file="bahtinov.dxf");
【讨论】:
我不认为你可以,但你可以在之后扩展它。
scaling_factor=0.5;
scale([scaling_factor,scaling_factor,1])
linear_extrude(height = 5, center = true, convexity = 10) import (file="bahtinov.dxf");
【讨论】: