MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Parsing polygon lists

  • To: mathgroup at
  • Subject: [mg8980] Re: Parsing polygon lists
  • From: "Xah" <xah at>
  • Date: Tue, 7 Oct 1997 03:35:27 -0400
  • Organization:
  • Sender: owner-wri-mathgroup at

In article <61713u$orl at>, Russell Towle <rustybel at>
>I wish to optimize the task of, given a large list of polygons in 3-space,
>some of which may fall into coincidence in pairs, to delete any such pairs
>from the list. The polygons are lists of vertices, and each vertex is a
>list of three real numbers.

Hi Russell,

Assuming that your list of polygons is flat. Improving upon your solution,
the following one should be faster. Suppose PolygonCentroid[Polygon[...]]
returns the centroid of a polygon.

(*this attaches the centroid as head to each polygon*)
polygonList /. poly_Polygon:>(PolygonCentroid at poly)@poly

Then you can use several techniques that remove duplicates. Something like

Union[{5[7],2[m],a[4],5[6]},SameTest->(Head at #1===Head@#2&)]

 xah at
 Mountain View, CA, USA 

  • Prev by Date: strange messsages when starting MMa
  • Next by Date: Re: TraceInternal and OptionQ
  • Previous by thread: Re: Parsing polygon lists
  • Next by thread: Limit[ E^(a x), x->-Infinity]