我们如何计算CSG对象的音量?

时间:2015-07-04 00:57:58

标签: openscad csg

在OpenSCAD中,我实现了以下动画:

WhR = 1.5; // wheel radius
WhH = 6; // wheel height
WpR = 1; // workpiece radius
WpH = 6; // workpiece height

$fn = 30;
pos = position($t);

intersection(){
rotate([0,-90,0]){
cylinder(WpH, WpR,WpR);
}

translate([pos,0,-2.5]){
cylinder(WhH,WhR,WhR);
}
}

function position(t) = -7.5 + t;

我的问题是,如何计算和输出"音量"在十字路口? [如果你知道如何在VTK或任何其他图书馆中这样做,请赐教!]

enter image description here

1 个答案:

答案 0 :(得分:0)

OpenSCAD不直接支持此功能。

RapCAD通过使用绑定的$():

来实现
bound$()cube(10);