📄 cogcornertest.html
字号:
<TITLE>A Corner</TITLE>
<H1>A Corner</H1>
<P>Returns a corner with three different boundary faces;
See <A HREF="cogfunctiontest.html">cogfunctiontest.html</A> and
<A HREF="cogfacetest.html">cogfacetest.html</A>
<PRE>
#include "cogfunction.hxx"
#include "cogfaces.hxx"
float px = 0.6;
float py = 0.7;
float pz = 0.8;
float dxy = px-py;
float dxz = px-pz;
float dyz = py-pz;
static cogSegment Faces(const cogPoint& x)
{
if(x[0] > x[1]+dxy)
if(x[0] > x[2]+dxz) return wzFace(2); // x is greatest
else return wzFace(4); // z is greatest
else
if(x[1] > x[2]+dyz) return wzFace(3); // y is greatest
else return wzFace(4); // z is greatest
}
static cogSegment Regions(const cogPoint& x)
{
if(x[0]>px) return wzRegion(1);
if(x[1]>py) return wzRegion(1);
if(x[2]>pz) return wzRegion(1);
return wzRegion(2);
}
cogeometry test_cogeometry()
{
cogeometry region = new CogeometrySimpleRegions(Regions);
// region->Delta = 1.e-6;
cogeometry faces = new CogeometrySimpleFaces(Faces,region);
// faces->Delta = 1.e-6;
return faces;
}
</PRE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -