Delete a specific polygon
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 01/04/2005 at 00:07, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 9.1
Platform:
Language(s) : C.O.F.F.E.E ;---------
Hello to all and tnx for the tecnichal support !!I have a little problem: how is possible to delete from one object a specific polygon ?
For example, i read the point coordinates of the polygon, and if this coordinates match one specific conditions i must delete it !!
Tnx in advance and sorry for my bad English !!
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 05/04/2005 at 02:36, xxxxxxxx wrote:
Nothing?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 05/04/2005 at 23:55, xxxxxxxx wrote:
This is the code:
<CODE>
var pip=op->GetPolygonCount(); if (!pip) return TRUE;
for (i=0; i<pip; i++)
{
var poly=op->GetPolygon(i);
var p1=int(p[poly->a].x);
var p2=int(p[poly->b].x);
var p3=int(p[poly->c].x);
var p4=int(p[poly->d].x);
if (p1==0 && p2==0 && p3==0 && p4==0)
{
var vc=new(VariableChanged);
var h,map=new(array, pip);
for(h=0; h<i; h++) map[h]=h;
for(h=i; h<pip; h++) map[h]=h-1;
vc->Init(pip,pip-1,map);
var ok = op->MultiMessage(MSG_POLYGONS_CHANGED,vc);
op->SetPolygons(map);
op->Message(MSG_UPDATE);
}
}
return TRUE;
}</CODE>
Tnx for answer!
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/04/2005 at 11:27, xxxxxxxx wrote:
Try this code with SendModelingComman()
var pip = op->GetPolygonCount() ; var pt = op->GetPoints() ; var sel = op->GetPolygonSelection() ; sel->DeselectAll() ; var i ; for (i=0; i<pip; i++) { var poly=op->GetPolygon(i); var p1=int(pt[poly->a].x); var p2=int(pt[poly->b].x); var p3=int(pt[poly->c].x); var p4=int(pt[poly->d].x); if (p1==0 && p2==0 && p3==0 && p4==0) sel->Select(i) ; } op->SetPolygonSelection(sel) ; var bc = new(BaseContainer) ; SendModelingCommand(MCOMMAND_DELETE, doc, op, bc, MODIFY_POLYGONSELECTION) ; op->Message(MSG_UPDATE);
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/04/2005 at 23:53, xxxxxxxx wrote:
Tnx Majo for the answer !!