问题标签 [openscad]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
module - 打开参数类型
使用 Open SCAD,我有一个模块,比如cube()
,它的size
参数可以是单个值或三个值的向量。最终,我想要一个包含三个值的向量。
如果调用者传递一个值,我希望向量的所有三个值都相同。我在语言文档中没有看到任何关于检测参数类型的内容。所以我想出了这个技巧:
当size
是单个值时,结果concat
正是我想要的:值的三个副本。
当size
是一个三值向量时,结果concat
是九值向量,而我的代码只是忽略了最后六个值。
它有效,但只是因为我在单值情况下想要复制该值。有没有一种通用的方法来打开参数类型并根据该类型做不同的事情?
openscad - 如何在 OpenSCAD 中循环使用多矩阵?
我希望将多维数据集端到端链接在一个循环内,这样我就可以仅使用它们如何添加在一起的动态规则而不是参数方程来构建由多维数据集组成的螺旋。即平移 1,倾斜 20',旋转 z 10'... 将制作一个 3d 螺旋计。
这是一个使用 openscad 递归的示例文件(与 openscad 循环相比,它的内存崩溃非常快)我希望使用循环做同样的事情吗?我很困惑。
scaletransform - understanding the linear_extrude operator in OpenSCAD
In OpenSCAD, the linear_extrude operator takes a 2d shape and extrudes it into 3d, optionally twisting it.
For example:
However, I found in the wiki: linear_extrude(height = 30, center = true, convexity=10, scale=[1,2]) square([20,10],center=true);
This one makes the "square" (which is actually a rectangle) bigger as it goes, scaling from 1 to 2. But it does so only in one dimension. I can't find how to make both dimensions scale equally, much less both dimensions scale differently.
The purpose in this case is to create a container that is not square, but gets wider towards the opening, necessary for ice cubes and molds for example so the material inside falls out easily.
3d - OpenSCAD: Do polyhedron faces have to be on the same plane?
I am currently trying to use OpenSCAD to create a ramp in a cylindrical shape:
(The code is here: https://bitbucket.org/snippets/robertmassaioli/5RBnp)
But I am currently getting errors when I try and generate an STL file. I think that might be because I am trying to generate this surface using quad faces but the docs say that all faces must be points along a plane:
When referencing more than 3 points in a single tuple, the points must all be on the same plane.
However, doing some basic maths I can see that the points between the inner loop and the outer loop do not form a plane. I think that is why you can see the obvious triangulation on the largest face in the image above. When I try and turn it into an STL file this happens:
However, if OpenSCAD notices that my faces will not work unless they are triangulated then should it not just convert my n-gons into triangles automatically? It seems to be doing that anyway for the preview panel.
The ultimate question is: am I right in thinking that this is my problem and why does not OpenSCAD fix it up automatically for me?
qt - 项目错误:Qt 中的未知模块:gui 小部件 printsupport macextras
我正在尝试在我的 Mac 上编译 OpenSCAD。当构建脚本到达该行时qmake qscintilla.pro
,它会吐出错误Project ERROR: Unknown module(s) in QT: gui opengl concurrent widgets printsupport macextras
如果我qmake
自己运行,我会收到更多关于缺少模块的错误,Project ERROR: Unknown module(s) in QT: gui opengl concurrent widgets printsupport macextras
我添加QT += macextras
到我的 qt.pro 文件中,看看它是否会停止抱怨 macextras,但这也不起作用.
我看了看里面qt-everywhere-opensource-src-5.4.1
,我可以看到qtmacextras
,但我没有看到提到的其他模块。
有什么想法可以为 Mac 获取这些模块吗?
我以为 qt 是由以下脚本编译的
openscad - 圆对象边缘的方法opensCAD
是否有一种简单的方法/功能可以为 openscad 对象圆边?
3d - OpenSCAD 2d 图转 3d 图
我在 OpenSCAD 中遇到问题,我知道语言,但我不知道解决问题。
可以说,我得到 2d 图形,例如 circle(r=25) 并且我想从中获得实心。但我想从那种固体中得到什么。
-> 在 h=0 上,有我的圆(r=25)
-> 在 h=10 上,有一个圆(r=35),所以一个圆,其实是按比例的,但是我不想用比例,因为它乘以一个数字,但我想让它从其中的每个点大 10 个点
-> 它看起来像截头圆锥
-> 它适用于其他数字,比如说多边形,但我们仍然让每个点大 10 个点
-> 我还需要一些相反的东西,我的意思是让身材变小
如何接近它?也许ner上有例子,所以如果你能把它们给我看,我将不胜感激
我试过什么?
如果 h = 10,那么对于 [0, ..., 10] 中的每个 h1,我尝试创建类似的东西:(blech)
看起来很糟糕,工作很糟糕而且没用,如果我想要更小的身材,我不知道如何让它工作
3d - openscad - 具有 2 个不同基数的 brik,其中一个基数为 2
假设我有 2 个基地,我想用它创建 brik,h=10
让第一个基地成为 A
让第二个基地成为
怎么做?当然在 openSCAD 中