Summary: OpenSCAD (version 2015.03-2) is the open source software for creating solid 3D CAD models. It is available for Linux/UNIX, Windows and Mac OS X, and it is a programming Solid 3D CAD Modeller. In this tutorial I will show you how to create Primitive Solids.
The Primitive Solids include cube, sphere, cylinder and polyhedron, let's start...
1)方块(cube)
创建方块有2中语法,如下:
cube(size = [x,y,z], center = true/false);
cube(size = x , center = true/false);
size指定方块的边长,center指定正方体的中心是否位于座标原点。如下图:
1.1)创建正方体:cube(size = x , center = true/false);
1.2)创建边长不一样的长方体:cube(size = [x,y,z], center = true/false);
2)球体(sphere)
创建球体可以指定半径或者直径,语法如下:
sphere(r = x);
sphere(d = x);
指定半径创建:
指定直径创建:
3)圆柱(锥,台)体(cylinder)
语法如下,当r1=r2的时候,是圆柱体;r1或者r2一个为0的时候是圆锥体;r1和r2都不为0,并且不相等的时候为圆台体;center指定物体的中心是否位于座标原点。
cylinder(h = height, r1 = BottomRadius, r2 = TopRadius, center = true/false);
圆柱体:
圆锥体:
圆台体:
通过指定内置参数$fn的数值,可以创建棱柱,棱锥和棱台体:
4)多面体(polyhedron)
语法如下,points指定多面体的顶点座标集,faces指定多面体每个面上顶点的索引,convexity指定在预览模式下与射线相交的最大面数。
polyhedron( points = [ [X0, Y0, Z0], [X1, Y1, Z1], ... ], faces = [ [P0, P1, P2, P3, ...], ... ], convexity = N);
比如下面用多面体的方法创建长方体:
Posted on Utopian.io - Rewarding Open Source Contributors
Hey @azcax I am @utopian-io. I have just upvoted you!
Achievements
Suggestions
Get Noticed!
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
@manishmike10, thanks!