📄 cogtubetest.html
字号:
<TITLE>Intersecting Tubes</TITLE>
<H1>Intersecting Tubes</H1>
<PRE>
#include "cogfunction.hxx"
#include "cogfaces.hxx"
float rr1 = 0.2*0.2;
float rr2 = 0.3*0.3;
static cogFloat Tube1(const cogPoint& x)
{
cogFloat dx = x[0] - 0.5;
cogFloat dy = x[1] - 0.3 - 0.1*x[2];
return dx*dx + dy*dy - rr1;
}
static cogFloat Tube2(const cogPoint& x)
{
cogFloat dy = x[1] - 0.6;
cogFloat dz = x[2] - 0.5;// - 0.1*x[0];
return dy*dy +dz*dz - rr2;
}
static cogSegment Faces(const cogPoint& x)
{
if(Tube1(x) > Tube2(x)) return wzFace(2);
else return wzFace(3);
}
static cogSegment Regions(const cogPoint& x)
{
if(Tube1(x) < 0) return wzRegion(2);
if(Tube2(x) < 0) return wzRegion(2);
return wzRegion(1);
}
cogeometry test_cogeometry()
{
cogeometry region = new CogeometrySimpleRegions(Regions);
cogeometry faces = new CogeometrySimpllFaces(Faces,region);
return faces;
}
</PRE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -