<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to dig holes in shell in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-dig-holes-in-shell/m-p/11402652#M2300</link>
    <description>&lt;LI-CODE lang="general"&gt;Adesk::Boolean
AsdkShellSamp::worldDraw(AcGiWorldDraw* pW)
{
    // Fill the faces with the current color.
    //

	using namespace std;
    pW-&amp;gt;subEntityTraits().setFillType(kAcGiFillAlways);
	AcGePoint3dArray pts;
	map&amp;lt;int,int&amp;gt; ijToInd;
	int row=4;
	int col=4;
	for(int i=0;i&amp;lt;row;i++)
	{
		for(int j=0;j&amp;lt;col;j++)
		{
			pts.append(AcGePoint3d(i,j,0));
			ijToInd.insert(make_pair(i*100+j,pts.length()-1));
		}
	}

	Adesk::UInt32 faceListSize = 5*(row-1)*(col-1);
	Adesk::Int32 *pFaceList
		= new Adesk::Int32[faceListSize];

	int ind=0;
	for(int i=0;i&amp;lt;row-1;i++)
	{
		for(int j=0;j&amp;lt;col-1;j++)
		{
			if(i==1&amp;amp;&amp;amp;j==1)
			{
				pFaceList[ind++] =- 4;   // 4vertices in the face
			}
			else
			{
				pFaceList[ind++] = 4;   // 4 vertices in the face
			}
			
			pFaceList[ind++] = ijToInd[(i)*100+j];   // pVerts[0]
			pFaceList[ind++] = ijToInd[(i+1)*100+j];   // pVerts[1]
			pFaceList[ind++] = ijToInd[(i+1)*100+j+1];   // pVerts[2]
			pFaceList[ind++] = ijToInd[(i)*100+j+1];   // pVerts[3]

		}
	}
	   AcGiFaceData faceData;
	   int numFaces = (row-1)*(col-1);
	   short *pFaceColorArray = new short[numFaces];
	   for(int i=0;i&amp;lt;numFaces;i++)
	   {
		   pFaceColorArray[i]=i;
	   }

	faceData.setColors(pFaceColorArray);

	pW-&amp;gt;geometry().shell(pts.length(), pts.asArrayPtr(), faceListSize,
		pFaceList, NULL,&amp;amp;faceData);
	delete [] pFaceList;
return true;
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;And then I got this result.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="walker2010cs_0-1662434667771.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1111982i5E29A620084BE31D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="walker2010cs_0-1662434667771.png" alt="walker2010cs_0-1662434667771.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What I want is that the cyan area in the middle is hollowed out.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Sep 2022 03:25:34 GMT</pubDate>
    <dc:creator>walker2010cs</dc:creator>
    <dc:date>2022-09-06T03:25:34Z</dc:date>
    <item>
      <title>How to dig holes in shell</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-dig-holes-in-shell/m-p/11402652#M2300</link>
      <description>&lt;LI-CODE lang="general"&gt;Adesk::Boolean
AsdkShellSamp::worldDraw(AcGiWorldDraw* pW)
{
    // Fill the faces with the current color.
    //

	using namespace std;
    pW-&amp;gt;subEntityTraits().setFillType(kAcGiFillAlways);
	AcGePoint3dArray pts;
	map&amp;lt;int,int&amp;gt; ijToInd;
	int row=4;
	int col=4;
	for(int i=0;i&amp;lt;row;i++)
	{
		for(int j=0;j&amp;lt;col;j++)
		{
			pts.append(AcGePoint3d(i,j,0));
			ijToInd.insert(make_pair(i*100+j,pts.length()-1));
		}
	}

	Adesk::UInt32 faceListSize = 5*(row-1)*(col-1);
	Adesk::Int32 *pFaceList
		= new Adesk::Int32[faceListSize];

	int ind=0;
	for(int i=0;i&amp;lt;row-1;i++)
	{
		for(int j=0;j&amp;lt;col-1;j++)
		{
			if(i==1&amp;amp;&amp;amp;j==1)
			{
				pFaceList[ind++] =- 4;   // 4vertices in the face
			}
			else
			{
				pFaceList[ind++] = 4;   // 4 vertices in the face
			}
			
			pFaceList[ind++] = ijToInd[(i)*100+j];   // pVerts[0]
			pFaceList[ind++] = ijToInd[(i+1)*100+j];   // pVerts[1]
			pFaceList[ind++] = ijToInd[(i+1)*100+j+1];   // pVerts[2]
			pFaceList[ind++] = ijToInd[(i)*100+j+1];   // pVerts[3]

		}
	}
	   AcGiFaceData faceData;
	   int numFaces = (row-1)*(col-1);
	   short *pFaceColorArray = new short[numFaces];
	   for(int i=0;i&amp;lt;numFaces;i++)
	   {
		   pFaceColorArray[i]=i;
	   }

	faceData.setColors(pFaceColorArray);

	pW-&amp;gt;geometry().shell(pts.length(), pts.asArrayPtr(), faceListSize,
		pFaceList, NULL,&amp;amp;faceData);
	delete [] pFaceList;
return true;
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;And then I got this result.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="walker2010cs_0-1662434667771.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1111982i5E29A620084BE31D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="walker2010cs_0-1662434667771.png" alt="walker2010cs_0-1662434667771.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What I want is that the cyan area in the middle is hollowed out.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 03:25:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-dig-holes-in-shell/m-p/11402652#M2300</guid>
      <dc:creator>walker2010cs</dc:creator>
      <dc:date>2022-09-06T03:25:34Z</dc:date>
    </item>
    <item>
      <title>回复： How to dig holes in shell</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-dig-holes-in-shell/m-p/11402684#M2301</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Solved, the hole must be completely in a certain face&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 03:58:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-dig-holes-in-shell/m-p/11402684#M2301</guid>
      <dc:creator>walker2010cs</dc:creator>
      <dc:date>2022-09-06T03:58:27Z</dc:date>
    </item>
  </channel>
</rss>

