20 #include <Inventor/SbBox.h>
21 #include <Inventor/actions/SoAction.h>
22 #include <Inventor/misc/SoChildList.h>
23 #include <Inventor/nodes/SoSeparator.h>
24 #include <Inventor/nodes/SoIndexedFaceSet.h>
25 #include <Inventor/nodes/SoNormal.h>
26 #include <Inventor/nodes/SoCoordinate3.h>
27 #include <Inventor/nodes/SoNormalBinding.h>
28 #include <Inventor/SoPrimitiveVertex.h>
29 #include <Inventor/elements/SoTextureCoordinateElement.h>
30 #include <Inventor/elements/SoGLCacheContextElement.h>
31 #include <Inventor/C/glue/gl.h>
43 SO_NODE_ADD_FIELD(fRmin, (0.0));
44 SO_NODE_ADD_FIELD(fRmax, (0.0));
45 SO_NODE_ADD_FIELD(fDz, (0.0));
46 SO_NODE_ADD_FIELD(fSPhi, (0.0));
47 SO_NODE_ADD_FIELD(fDPhi, ((
float)(2*
M_PI)));
48 SO_NODE_ADD_FIELD(smoothDraw, (
TRUE));
49 SO_NODE_ADD_FIELD(pOverrideNPhi, (0));
50 SO_NODE_ADD_FIELD(alternateRep, (NULL));
51 SO_NODE_ADD_FIELD(drawEdgeLines, (
false));
53 m_children =
new SoChildList(
this);
55 float rMinDef[]={10.0, 15.0, 10.0};
56 float rMaxDef[]={11.0, 17.0, 12.0};
57 float zDef []={-10.0, 0.0, 10.0};
59 fRmin.setValues(0,2,rMinDef);
60 fRmax.setValues(0,2,rMaxDef);
61 fDz.setValues(0,2,zDef);
62 setNodeType(EXTENSION);
74 [[maybe_unused]]
static const bool didInit = [&]() {
75 SO_NODE_INIT_CLASS(
SoPcons,SoShape,
"Shape");
86 SoState *state =
action->getState();
92 SbBool useTexFunction=
94 SoTextureCoordinateElement::FUNCTION);
99 const SoTextureCoordinateElement *tce = NULL;
101 if (useTexFunction) {
102 tce = SoTextureCoordinateElement::getInstance(state);
107 SbVec3f point, normal;
111 #define GEN_VERTEX(pv,x,y,z,s,t,nx,ny,nz) \
112 point.setValue((float)(x),(float)(y),(float)(z)); \
113 normal.setValue((float)(nx),(float)(ny),(float)(nz)); \
114 if (useTexFunction) { \
115 texCoord=tce->get(point,normal); \
117 texCoord[0]=(float)(s); \
118 texCoord[1]=(float)(t); \
120 pv.setPoint(point); \
121 pv.setNormal(normal); \
122 pv.setTextureCoords(texCoord); \
131 int nSeg =
fRmin.getNum()-1;
136 for (
int p=0;
p<nSeg;
p++) {
144 double zMin =
fDz[
p];
145 double zMax=
fDz[
p+1];
154 double cosPhi1 =
cos(phi1);
155 double sinPhi1 =
sin(phi1);
163 const bool noPhiCutout=fabs(
fDPhi.getValue())==0.F || fabs(fabs(
fDPhi.getValue())-2.0*
M_PI)<0.01;
164 const bool disableLighting(glIsEnabled(GL_LIGHTING));
165 const bool transparencyOn(glIsEnabled(GL_BLEND));
173 double dR =rMax2-rMax1;
174 double dZ =zMax-zMin;
175 double cosTheta = -dR/sqrt(dR*dR+dZ*dZ);
176 double sinTheta = dZ/sqrt(dR*dR+dZ*dZ);
178 beginShape(
action,TRIANGLE_STRIP);
181 for (
i = 0;
i<=NPHI;
i++) {
182 GEN_VERTEX(
pv,rMax2*cosPhi,rMax2*sinPhi,zMax,0.0,0.0,sinTheta*cosPhi,sinTheta*sinPhi,cosTheta);
183 GEN_VERTEX(
pv,rMax1*cosPhi,rMax1*sinPhi,zMin,1.0,1.0,sinTheta*cosPhi,sinTheta*sinPhi,cosTheta);
184 inc(sinPhi, cosPhi, sinDeltaPhi, cosDeltaPhi);
189 if (disableLighting) glDisable(GL_LIGHTING);
190 if (transparencyOn) glDisable(GL_BLEND);
191 glBegin(GL_LINE_STRIP);
194 if (!noPhiCutout &&
p==0) glVertex3f(rMin1*cosPhi,rMin1*sinPhi,zMin);
195 for (
i = 0;
i<=NPHI;
i++) {
196 glVertex3f(rMax1*cosPhi,rMax1*sinPhi,zMin);
197 inc(sinPhi, cosPhi, sinDeltaPhi, cosDeltaPhi);
199 if (!noPhiCutout &&
p==0) glVertex3f(rMin1*cosPhi1,rMin1*sinPhi1,zMin);
201 if (disableLighting) glEnable(GL_LIGHTING);
202 if (transparencyOn) glEnable(GL_BLEND);
211 beginShape(
action,TRIANGLE_STRIP);
217 cosTheta = -dR/sqrt(dR*dR+dZ*dZ);
218 sinTheta = dZ/sqrt(dR*dR+dZ*dZ);
220 for (
i = 0;
i<=NPHI;
i++) {
221 GEN_VERTEX(
pv,rMin2*cosPhi,rMin2*sinPhi,zMax,0.0,0.0,-cosPhi*sinTheta,-sinPhi*sinTheta,-cosTheta);
222 GEN_VERTEX(
pv,rMin1*cosPhi,rMin1*sinPhi,zMin,1.0,1.0,-cosPhi*sinTheta,-sinPhi*sinTheta,-cosTheta);
223 inc(sinPhi, cosPhi, sinDeltaPhi, cosDeltaPhi);
228 if (disableLighting) glDisable(GL_LIGHTING);
229 if (transparencyOn) glDisable(GL_BLEND);
230 glBegin(GL_LINE_STRIP);
234 for (
i = 0;
i<=NPHI;
i++) {
235 glVertex3f(rMin1*cosPhi,rMin1*sinPhi,zMin);
236 inc(sinPhi, cosPhi, sinDeltaPhi, cosDeltaPhi);
240 if (disableLighting) glEnable(GL_LIGHTING);
241 if (transparencyOn) glEnable(GL_BLEND);
251 beginShape(
action,TRIANGLE_STRIP);
254 GEN_VERTEX(
pv,rMax2*cosPhi,rMax2*sinPhi,zMax,0.0,0.0,sinPhi,-cosPhi,0);
255 GEN_VERTEX(
pv,rMax1*cosPhi,rMax1*sinPhi,zMin,1.0,1.0,sinPhi,-cosPhi,0);
256 GEN_VERTEX(
pv,rMin2*cosPhi,rMin2*sinPhi,zMax,1.0,0.0,sinPhi,-cosPhi,0);
257 GEN_VERTEX(
pv,rMin1*cosPhi,rMin1*sinPhi,zMin,0.0,1.0,sinPhi,-cosPhi,0);
262 beginShape(
action,TRIANGLE_STRIP);
265 GEN_VERTEX(
pv,rMax2*cosPhi,rMax2*sinPhi, zMax,0.0,0.0,-sinPhi,+cosPhi,0);
266 GEN_VERTEX(
pv,rMax1*cosPhi,rMax1*sinPhi, zMin,1.0,1.0,-sinPhi,+cosPhi,0);
267 GEN_VERTEX(
pv,rMin2*cosPhi,rMin2*sinPhi, zMax,1.0,0.0,-sinPhi,+cosPhi,0);
268 GEN_VERTEX(
pv,rMin1*cosPhi,rMin1*sinPhi, zMin,0.0,1.0,-sinPhi,+cosPhi,0);
272 if (disableLighting) glDisable(GL_LIGHTING);
273 if (transparencyOn) glDisable(GL_BLEND);
276 glVertex3f(rMax2*cosPhi0,rMax2*sinPhi0, zMax);
277 glVertex3f(rMax1*cosPhi0,rMax1*sinPhi0, zMin);
278 glVertex3f(rMin2*cosPhi0,rMin2*sinPhi0, zMax);
279 glVertex3f(rMin1*cosPhi0,rMin1*sinPhi0, zMin);
280 glVertex3f(rMax2*cosPhi1,rMax2*sinPhi1, zMax);
281 glVertex3f(rMax1*cosPhi1,rMax1*sinPhi1, zMin);
282 glVertex3f(rMin2*cosPhi1,rMin2*sinPhi1, zMax);
283 glVertex3f(rMin1*cosPhi1,rMin1*sinPhi1, zMin);
285 if (disableLighting) glEnable(GL_LIGHTING);
286 if (transparencyOn) glEnable(GL_BLEND);
295 beginShape(
action,TRIANGLE_STRIP);
298 for (
i = 0;
i<=NPHI;
i++) {
299 GEN_VERTEX(
pv,rMin2*cosPhi,rMin2*sinPhi,zMax,0.0,0.0,0,0,1);
300 GEN_VERTEX(
pv,rMax2*cosPhi,rMax2*sinPhi,zMax,1.0,1.0,0,0,1);
301 inc(sinPhi, cosPhi, sinDeltaPhi, cosDeltaPhi);
306 if (disableLighting) glDisable(GL_LIGHTING);
307 if (transparencyOn) glDisable(GL_BLEND);
308 glBegin(GL_LINE_STRIP);
311 if (!noPhiCutout) glVertex3f(rMin1*cosPhi,rMin1*sinPhi,zMax);
312 for (
i = 0;
i<=NPHI;
i++) {
313 glVertex3f(rMax1*cosPhi,rMax1*sinPhi,zMax);
314 inc(sinPhi, cosPhi, sinDeltaPhi, cosDeltaPhi);
316 if (!noPhiCutout) glVertex3f(rMin1*cosPhi1,rMin1*sinPhi1,zMax);
318 if (disableLighting) glEnable(GL_LIGHTING);
319 if (transparencyOn) glEnable(GL_BLEND);
327 beginShape(
action,TRIANGLE_STRIP);
330 for (
i = 0;
i<=NPHI;
i++) {
331 GEN_VERTEX(
pv,rMin1*cosPhi,rMin1*sinPhi,zMin,0.0,0.0,0,0,-1);
332 GEN_VERTEX(
pv,rMax1*cosPhi,rMax1*sinPhi,zMin,1.0,1.0,0,0,-1);
333 inc(sinPhi, cosPhi, sinDeltaPhi, cosDeltaPhi);
339 if (state&&state->isElementEnabled(SoGLCacheContextElement::getClassStackIndex())) {
341 SoGLCacheContextElement::shouldAutoCache(state, SoGLCacheContextElement::DO_AUTO_CACHE);
342 #if ((COIN_MAJOR_VERSION>=3)||((COIN_MAJOR_VERSION==2)&&(COIN_MINOR_VERSION>=5)))
343 SoGLCacheContextElement::incNumShapes(state);
356 if (
fRmax.getNum()< 2)
return;
357 if (
fRmin.getNum()< 2)
return;
358 if (
fDz.getNum() < 2)
return;
360 double MinMin =
fRmin[0];
361 double MaxMax =
fRmax[0];
363 double ZMin =
fDz[0];
364 double ZMax =
fDz[0];
367 for (
int i=1;
i<
fRmin.getNum();++
i) {
371 for (
int i=1;
i<
fRmax.getNum();++
i) {
375 for (
int i=1;
i<
fDz.getNum();++
i) {
400 SoCoordinate3 *theCoordinates = (SoCoordinate3 *) (
sep->getChild(0));
401 SoNormal *theNormals = (SoNormal *) (
sep->getChild(1));
402 SoNormalBinding *theNormalBinding = (SoNormalBinding *) (
sep->getChild(2));
403 SoIndexedFaceSet *theFaceSet = (SoIndexedFaceSet *) (
sep->getChild(3));
405 const int NPHI=96, NPOINTS=2*(2*NPHI+2), NFACES=4*NPHI+2, NINDICES = NFACES*5;
406 float points[NPOINTS][3], normals[NFACES][3];
410 static int32_t
indices[NINDICES];
413 double phi, pp, DeltaPhi;
426 for (
i = 0;
i< NPHI;
i++) {
435 for (
i=0;
i<NPHI;
i++) {
436 indices[5*1*NPHI + 5*
i+0] = 2*NPHI+2 + 2*
i+0;
437 indices[5*1*NPHI + 5*
i+1] = 2*NPHI+2 + 2*
i+1;
438 indices[5*1*NPHI + 5*
i+2] = 2*NPHI+2 + 2*
i+3;
439 indices[5*1*NPHI + 5*
i+3] = 2*NPHI+2 + 2*
i+2;
440 indices[5*1*NPHI + 5*
i+4] = SO_END_FACE_INDEX;
443 for (
i=0;
i<NPHI;
i++) {
446 indices[5*2*NPHI + 5*
i+2] = NPOINTS - (2*
i+4);
447 indices[5*2*NPHI + 5*
i+3] = NPOINTS - (2*
i+2);
448 indices[5*2*NPHI + 5*
i+4] = SO_END_FACE_INDEX;
451 for (
i=0;
i<NPHI;
i++) {
453 indices[5*3*NPHI + 5*
i+1] = NPOINTS - (2*
i+1);
454 indices[5*3*NPHI + 5*
i+2] = NPOINTS - (2*
i+3);
456 indices[5*3*NPHI + 5*
i+4] = SO_END_FACE_INDEX;
460 indices[5*4*NPHI +1] = 2*NPHI+1;
461 indices[5*4*NPHI +2] = 2*NPHI+3;
462 indices[5*4*NPHI +3] = 2*NPHI+2;
463 indices[5*4*NPHI +4] = SO_END_FACE_INDEX;
466 indices[5*4*NPHI +5 +1] = NPOINTS-2;
467 indices[5*4*NPHI +5 +2] = NPOINTS-1;
469 indices[5*4*NPHI +5 +4] = SO_END_FACE_INDEX;
475 t =
FATAN((fRmax2.getValue()-fRmax1.getValue())/(2*
fDz.getValue()));
478 for (
i = 0;
i<=NPHI;
i++) {
479 points[2*
i+0][0] = fRmax2.getValue()*
FCOS(
phi);
480 points[2*
i+0][1] = fRmax2.getValue()*
FSIN(
phi);
481 points[2*
i+0][2] = +
fDz.getValue();
482 points[2*
i+1][0] = fRmax1.getValue()*
FCOS(
phi);
483 points[2*
i+1][1] = fRmax1.getValue()*
FSIN(
phi);
484 points[2*
i+1][2] = -
fDz.getValue();
485 pp =
phi+DeltaPhi/2.0;
495 t =
FATAN((fRmin2.getValue()-fRmin1.getValue())/(2*
fDz.getValue()));
498 for (
i = 0;
i<=NPHI;
i++) {
499 points[2*NPHI+2+2*
i+0][0] = fRmin2.getValue()*
FCOS(
phi);
500 points[2*NPHI+2+2*
i+0][1] = fRmin2.getValue()*
FSIN(
phi);
501 points[2*NPHI+2+2*
i+0][2] = +
fDz.getValue();
502 points[2*NPHI+2+2*
i+1][0] = fRmin1.getValue()*
FCOS(
phi);
503 points[2*NPHI+2+2*
i+1][1] = fRmin1.getValue()*
FSIN(
phi);
504 points[2*NPHI+2+2*
i+1][2] = -
fDz.getValue();
505 pp =
phi-DeltaPhi/2.0;
507 normals[NPHI+
i][0] = -
ct*
FCOS(pp);
508 normals[NPHI+
i][1] = -
ct*
FSIN(pp);
509 normals[NPHI+
i][2] = st;
514 for (
i=0;
i<NPHI;
i++) {
515 normals[2*NPHI+
i][0]=normals[2*NPHI+
i][1]=0;
516 normals[2*NPHI+
i][2]= 1.0;
519 for (
i=0;
i<NPHI;
i++) {
520 normals[3*NPHI+
i][0]=normals[3*NPHI+
i][1]=0;
521 normals[3*NPHI+
i][2]= -1.0;
525 normals[4*NPHI+0][0]=
FSIN(
phi);
526 normals[4*NPHI+0][1]= -
FCOS(
phi);
527 normals[4*NPHI+0][2]= 0;
531 normals[4*NPHI+1][0]= -
FSIN(
phi);
532 normals[4*NPHI+1][1]= +
FCOS(
phi);
533 normals[4*NPHI+1][2]=0;
535 for (
int np=0;
np<NPOINTS;
np++) theCoordinates->point.set1Value(
np,points[
np][0],points[
np][1],points[
np][2]);
536 theFaceSet->coordIndex.setValues(0,NINDICES,
indices);
540 for (
int nf=0;
nf<NFACES;
nf++) theNormals->vector.set1Value(
nf,normals[
nf][0],normals[
nf][1],normals[
nf][2]);
541 theNormalBinding->value=SoNormalBinding::PER_FACE;
544 for (
int nf=0;
nf<NFACES;
nf++) theNormals->vector.set1Value(
nf,normals[
nf][0],normals[
nf][1],normals[
nf][2]);
545 theNormalBinding->value=SoNormalBinding::PER_FACE;
562 SoSeparator *
sep =
new SoSeparator();
563 SoCoordinate3 *theCoordinates =
new SoCoordinate3();
564 SoNormal *theNormals =
new SoNormal();
565 SoNormalBinding *theNormalBinding =
new SoNormalBinding();
566 SoIndexedFaceSet *theFaceSet =
new SoIndexedFaceSet();
570 sep->addChild(theCoordinates);
571 sep->addChild(theNormals);
572 sep->addChild(theNormalBinding);
573 sep->addChild(theFaceSet);
606 SoPrimitiveVertex
pv;
609 std::vector<SoPrimitiveVertex> vls;
612 std::vector<SoPrimitiveVertex> fls;
620 SbVec3f point, normal;
624 #define N_GEN_VERTEX(ls, pv,x,y,z,s,t,nx,ny,nz) \
625 point.setValue((float)(x),(float)(y),(float)(z)); \
626 normal.setValue((float)(nx),(float)(ny),(float)(nz)); \
627 texCoord[0]=(float)(s); \
628 texCoord[1]=(float)(t); \
629 pv.setPoint(point); \
630 pv.setNormal(normal); \
631 pv.setTextureCoords(texCoord); \
639 int nSeg =
fRmin.getNum()-1;
644 for (
int p=0;
p<nSeg;
p++) {
652 double zMin =
fDz[
p];
653 double zMax=
fDz[
p+1];
660 double cosPhi1 =
cos(phi1);
661 double sinPhi1 =
sin(phi1);
669 const bool noPhiCutout=fabs(
fDPhi.getValue())==0.F || fabs(fabs(
fDPhi.getValue())-2.0*
M_PI)<0.01;
674 double dR =rMax2-rMax1;
675 double dZ =zMax-zMin;
676 double cosTheta = -dR/sqrt(dR*dR+dZ*dZ);
677 double sinTheta = dZ/sqrt(dR*dR+dZ*dZ);
681 for (
i = 0;
i<=NPHI;
i++) {
682 N_GEN_VERTEX(vls,
pv,rMax2*cosPhi,rMax2*sinPhi,zMax,0.0,0.0,sinTheta*cosPhi,sinTheta*sinPhi,cosTheta);
683 N_GEN_VERTEX(vls,
pv,rMax1*cosPhi,rMax1*sinPhi,zMin,1.0,1.0,sinTheta*cosPhi,sinTheta*sinPhi,cosTheta);
684 inc(sinPhi, cosPhi, sinDeltaPhi, cosDeltaPhi);
687 for(
i = 0;
i < ((
int)vls.size() - 2);
i += 2){
688 fls.push_back(vls[
i + 0]);
689 fls.push_back(vls[
i + 1]);
690 fls.push_back(vls[
i + 3]);
691 fls.push_back(vls[
i + 2]);
703 cosTheta = -dR/sqrt(dR*dR+dZ*dZ);
704 sinTheta = dZ/sqrt(dR*dR+dZ*dZ);
706 for (
i = 0;
i<=NPHI;
i++) {
707 N_GEN_VERTEX(vls,
pv,rMin2*cosPhi,rMin2*sinPhi,zMax,0.0,0.0,-cosPhi*sinTheta,-sinPhi*sinTheta,-cosTheta);
708 N_GEN_VERTEX(vls,
pv,rMin1*cosPhi,rMin1*sinPhi,zMin,1.0,1.0,-cosPhi*sinTheta,-sinPhi*sinTheta,-cosTheta);
709 inc(sinPhi, cosPhi, sinDeltaPhi, cosDeltaPhi);
711 for(
i = 0;
i < ((
int)vls.size() - 2);
i += 2){
712 fls.push_back(vls[
i + 1]);
713 fls.push_back(vls[
i + 0]);
714 fls.push_back(vls[
i + 2]);
715 fls.push_back(vls[
i + 3]);
726 N_GEN_VERTEX(vls,
pv,rMax2*cosPhi,rMax2*sinPhi,zMax,0.0,0.0,sinPhi,-cosPhi,0);
727 N_GEN_VERTEX(vls,
pv,rMax1*cosPhi,rMax1*sinPhi,zMin,1.0,1.0,sinPhi,-cosPhi,0);
728 N_GEN_VERTEX(vls,
pv,rMin2*cosPhi,rMin2*sinPhi,zMax,1.0,0.0,sinPhi,-cosPhi,0);
729 N_GEN_VERTEX(vls,
pv,rMin1*cosPhi,rMin1*sinPhi,zMin,0.0,1.0,sinPhi,-cosPhi,0);
730 fls.push_back(vls[1]);
731 fls.push_back(vls[0]);
732 fls.push_back(vls[2]);
733 fls.push_back(vls[3]);
741 N_GEN_VERTEX(vls,
pv,rMax2*cosPhi,rMax2*sinPhi, zMax,0.0,0.0,-sinPhi,+cosPhi,0);
742 N_GEN_VERTEX(vls,
pv,rMax1*cosPhi,rMax1*sinPhi, zMin,1.0,1.0,-sinPhi,+cosPhi,0);
743 N_GEN_VERTEX(vls,
pv,rMin2*cosPhi,rMin2*sinPhi, zMax,1.0,0.0,-sinPhi,+cosPhi,0);
744 N_GEN_VERTEX(vls,
pv,rMin1*cosPhi,rMin1*sinPhi, zMin,0.0,1.0,-sinPhi,+cosPhi,0);
745 fls.push_back(vls[0]);
746 fls.push_back(vls[1]);
747 fls.push_back(vls[3]);
748 fls.push_back(vls[2]);
757 for (
i = 0;
i<=NPHI;
i++) {
758 N_GEN_VERTEX(vls,
pv,rMin2*cosPhi,rMin2*sinPhi,zMax,0.0,0.0,0,0,1);
759 N_GEN_VERTEX(vls,
pv,rMax2*cosPhi,rMax2*sinPhi,zMax,1.0,1.0,0,0,1);
760 inc(sinPhi, cosPhi, sinDeltaPhi, cosDeltaPhi);
762 for(
i = 0;
i < ((
int)vls.size() - 2);
i += 2){
763 fls.push_back(vls[
i + 0]);
764 fls.push_back(vls[
i + 1]);
765 fls.push_back(vls[
i + 3]);
766 fls.push_back(vls[
i + 2]);
776 for (
i = 0;
i<=NPHI;
i++) {
777 N_GEN_VERTEX(vls,
pv,rMin1*cosPhi,rMin1*sinPhi,zMin,0.0,0.0,0,0,-1);
778 N_GEN_VERTEX(vls,
pv,rMax1*cosPhi,rMax1*sinPhi,zMin,1.0,1.0,0,0,-1);
779 inc(sinPhi, cosPhi, sinDeltaPhi, cosDeltaPhi);
781 for(
i = 0;
i < ((
int)vls.size() - 2);
i += 2){
782 fls.push_back(vls[
i + 1]);
783 fls.push_back(vls[
i + 0]);
784 fls.push_back(vls[
i + 2]);
785 fls.push_back(vls[
i + 3]);
797 int numFaces = fls.size() / 4;
801 SoVertexProperty *vertices =
new SoVertexProperty();
802 for(
int i = 0;
i < (
int)fls.size();
i++){
803 vertices->vertex.set1Value (
i, fls[
i].getPoint()[0],
804 fls[
i].getPoint()[1],
805 fls[
i].getPoint()[2]);
809 int* faces =
new int[5 * numFaces];
810 fprintf(
stderr,
"\nallocate Faces: %i", numFaces);
811 for(
int i = 0;
i < numFaces;
i++){
812 faces[5 *
i] = 4 *
i;
813 faces[5 *
i + 1] = 4 *
i + 1;
814 faces[5 *
i + 2] = 4 *
i + 2;
815 faces[5 *
i + 3] = 4 *
i + 3;
816 faces[5 *
i + 4] = -1;
819 SoIndexedFaceSet * faceset =
new SoIndexedFaceSet;
820 faceset->coordIndex.setValues(0, 5 * numFaces, faces);
822 faceset->vertexProperty = vertices;