码迷,mamicode.com
首页 > 其他好文 > 详细

OpenSCAD空间几何布尔运算

时间:2015-02-09 18:48:30      阅读:205      评论:0      收藏:0      [点我收藏+]

标签:

原文地址(英): https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#difference

Union:合并

创建一个合并的对象,使用union操作符,如下图所示。

Usage example:

union() {
        cylinder (h = 4, r=1, center = true, $fn=100);
        rotate ([90,0,0]) cylinder (h = 4, r=0.9, center = true, $fn=100);
}

    注意: union是隐含的,当未使用时。但当两个对象相交时,就成为必然的操作。

技术分享

difference:切割

    从主对象中把所有字对象挖出,如下所示:

    Usage example:

difference() {
        cylinder (h = 4, r=1, center = true, $fn=100);
        rotate ([90,0,0]) cylinder (h = 4, r=0.9, center = true, $fn=100);
}


技术分享


intersection:求交

    创建所有子对象的交集,保留重叠的部分。如下所示:

Usage example:

intersection() {
        cylinder (h = 4, r=1, center = true, $fn=100);
        rotate ([90,0,0]) cylinder (h = 4, r=0.9, center = true, $fn=100);
}


技术分享


render:渲染

总是计算CSG model(even in OpenCSG preview mode).

Usage example:
render(convexity = 1) { ... }


convexity Integer. The convexity parameter specifies the maximum number of front sides (back sides) a ray intersecting the object might penetrate. This parameter is only needed for correctly displaying the object in OpenCSG preview mode and has no effect on the polyhedron rendering.


技术分享

This image shows a 2D shape with a convexity of 4, as the ray indicated in red crosses the 2D shape a maximum of 4 times. The convexity of a 3D shape would be determined in a similar way. Setting it to 10 should work fine for most cases.


OpenSCAD空间几何布尔运算

标签:

原文地址:http://my.oschina.net/u/2306127/blog/376741

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!