我是 openscad 的新手,正在尝试从 dxf 文件制作 3d 模型。我想将其大小指定为 130x130。我已经能够达到下面的代码,但它仍然没有断言我想要的大小:
linear_extrude(height = 5, center = true, convexity = 10) import (file="bahtinov.dxf");
任何帮助表示赞赏!
我是 openscad 的新手,正在尝试从 dxf 文件制作 3d 模型。我想将其大小指定为 130x130。我已经能够达到下面的代码,但它仍然没有断言我想要的大小:
linear_extrude(height = 5, center = true, convexity = 10) import (file="bahtinov.dxf");
任何帮助表示赞赏!
您可以使用dxf_dim()
:在您的 dxf 中创建另一个图层,例如“尺寸”,使用最大值绘制水平和垂直尺寸线。宽度分别 最大。文档中描述的高度,作为标识符,例如“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");