首页 > 其他 > 详细

openscad 3Dmodels 笔记

时间:2018-12-13 15:49:16      阅读:292      评论:0      收藏:0      [点我收藏+]

参考链接

官方文档
官方文档之——代码

概述

  • 默认界面左边是代码,右边是预览图
  • Ctrl + D 可注释选中行(从edit菜单栏中得知)
  • 以下按钮预览(鼠标停留可显示文字preview)
    技术分享图片

命令

几何体

cube(10);  //边长为10的正方体,锚点在其一角
cube([2,3,4]); //长宽高分别为2,3,4的长方体,锚点在其一角
cube(15, center=true);  //边长为15的正方体,锚点在其中心

sphere(10); //半径为10的球体

几何变换

translate([-24,0,0])  //平移
union()  //并
intersection //交
difference() // 差

例子:
技术分享图片

文字

官方文档——text用法

text(letter, 
                     size=size*22/30,
                     font="Bitstream Vera Sans",
                     halign="center",
                     valign="center");

linear Extrude

linear_extrude(height = fanwidth, center = true, convexity = 10, twist = -fanrot, slices = 20, scale = 1.0, $fn = 16) {...}

其他

echo(字符串变量); 会在右边控制台console中第三行左右显示
技术分享图片

$fa, $fs and $fn

The $fa, $fs and $fn special variables control the number of facets used to generate an arc:

  • $fa is the minimum angle for a fragment. Even a huge circle does not have more fragments than 360 divided by this number. The default value is 12 (i.e. 30 fragments for a full circle). The minimum allowed value is 0.01. Any attempt to set a lower value will cause a warning.

  • $fs is the minimum size of a fragment. Because of this variable very small circles have a smaller number of fragments than specified using $fa. The default value is 2. The minimum allowed value is 0.01. Any attempt to set a lower value will cause a warning.

  • $fn is usually 0. When this variable has a value greater than zero, the other two variables are ignored and full circle is rendered using this number of fragments. The default value is 0.

openscad 3Dmodels 笔记

原文:https://www.cnblogs.com/YuQiao0303/p/10113976.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!