Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1997
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1997

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

Search the Archive

Re: Parsing polygon lists

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

In article <61713u$orl at smc.vnet.net>, Russell Towle <rustybel at foothill.net>
wrote:
>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
 xah at best.com
 http://www.best.com/~xah/SpecialPlaneCurves_dir/specialPlaneCurves.html
 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]