OpenSCAD教程之"创建基本3D物体" | OpenSCAD tutorial -- Create Primitive Solids

in #utopian-io7 years ago (edited)

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);

图片.png

图片.png

1.2)创建边长不一样的长方体:cube(size = [x,y,z], center = true/false);

图片.png

图片.png

2)球体(sphere)

创建球体可以指定半径或者直径,语法如下:
sphere(r = x);
sphere(d = x);

指定半径创建:
图片.png

指定直径创建:
图片.png

3)圆柱(锥,台)体(cylinder)

语法如下,当r1=r2的时候,是圆柱体;r1或者r2一个为0的时候是圆锥体;r1和r2都不为0,并且不相等的时候为圆台体;center指定物体的中心是否位于座标原点。

cylinder(h = height, r1 = BottomRadius, r2 = TopRadius, center = true/false);

圆柱体:

图片.png

图片.png

圆锥体:

图片.png

图片.png

图片.png

图片.png

圆台体:

图片.png

图片.png

图片.png

图片.png

通过指定内置参数$fn的数值,可以创建棱柱,棱锥和棱台体:

图片.png

图片.png

图片.png

4)多面体(polyhedron)

语法如下,points指定多面体的顶点座标集,faces指定多面体每个面上顶点的索引,convexity指定在预览模式下与射线相交的最大面数。

polyhedron( points = [ [X0, Y0, Z0], [X1, Y1, Z1], ... ], faces = [ [P0, P1, P2, P3, ...], ... ], convexity = N);

比如下面用多面体的方法创建长方体:

图片.png

图片.png



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Hey @azcax I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • This is your first accepted contribution here in Utopian. Welcome!

Suggestions

  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!

Get Noticed!

  • Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

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]

Congratulations @azcax, you have decided to take the next big step with your first post! The Steem Network Team wishes you a great time among this awesome community.


Thumbs up for Steem Network´s strategy

The proven road to boost your personal success in this amazing Steem Network

Do you already know that awesome content will get great profits by following these simple steps, that have been worked out by experts?

Coin Marketplace

STEEM 0.20
TRX 0.24
JST 0.038
BTC 96590.30
ETH 3333.92
USDT 1.00
SBD 3.16