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

MathGroup Archive 2005

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

Search the Archive

Re: Rendering goes into infinite loop

  • To: mathgroup at smc.vnet.net
  • Subject: [mg62793] Re: Rendering goes into infinite loop
  • From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
  • Date: Mon, 5 Dec 2005 13:40:56 -0500 (EST)
  • Organization: Uni Leipzig
  • References: <dmtbku$fmc$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

the graphics has several polygons that overlap complete. This
cause Mathematicas painter algoritm to hang up because it can't split
the polygons into non-overalping pices.

Regards
  Jens


"Steven T. Hatton" <hattons at globalsymmetry.com> 
schrieb im Newsbeitrag 
news:dmtbku$fmc$1 at smc.vnet.net...
| The following is an example from _The 
Mathematica GuideBook for
| Programming_, chapter 6. I made a few minor 
modification.  For
| one, I set the DisplayFunction->Identity.  I 
also changed the
| ViewPoint->{1.300, -2.400, 2.000}.  It was 
originally
| ViewPoint->{1, 1, 1}.  With that value, I found 
the kernel
| went into what appeared to be an infinite loop. 
I could kill
| the kernel and get the front end back, but while 
the kernel ran,
| I could not interact with the front end at all. 
I suspect this
| is Linux specific.  Could I get some people to 
test this to see
| if there is a problem on other systems?
|
| I'm running SuSE 10 on a P4.  The display 
manager doesn't seem to
| be the problem.  I tried different DMs and 
windown managers.
|
| In[1]:= GluedPolygons[n_Integer?(# >= 3&), 
angle:\[Alpha]_?(Im[N[#]] === 0&),
|              iter__Integer?(# >= 0&), 
faceShape:(Polygon | Line),
|              opts___Rule] :=
| Module[{c = N[Cos[\[Alpha]]], s = 
N[Sin[\[Alpha]]], myUnion, \[ScriptR], 
\[ScriptCapitalR], allm, argch,
|        makeHole, makeLine, \[ScriptN] = 
#/Sqrt[#.#]&, \[CurlyEpsilon] = 10^-6},
| myUnion[l_] := Union[l, SameTest -> ((Plus @@ 
(#.#& /@ (#1 - #2))) < \[CurlyEpsilon]&)];
|
| \[ScriptR][point_, rotPoint_, {dir1_, dir2_, 
dir3_}] :=
| Module[{\[Delta] = point - rotPoint, parallel, 
normal},
|        parallel = \[Delta].dir1 dir1;
|        normal = Sqrt[#.#]&[\[Delta] - parallel];
|        rotPoint + c normal dir2 + s normal dir3 
+ parallel];
|
| \[ScriptCapitalR][l_] := Module[{dir1, dir2, 
dir3},
|       (* three orthogonal directions *)
|       dir1 = \[ScriptN][Subtract @@ Take[l, 2]];
|       dir2 = \[ScriptN][(Plus @@ l)/Length[l] - 
(Plus @@ Take[l, 2])/2];
|       dir3 = -Cross[dir1, dir2];
|       Map[N[\[ScriptR][#, l[[1]], {dir1, dir2, 
dir3}]]&, l, {-2}]];
|
| allm[l_] := Table[RotateLeft[l, i], {i, 
Length[l] - 1}];
| argch[l_] := Join[Reverse[Take[l, 2]], 
Reverse[Drop[l, 2]]];
|
| makeHole[l_] :=
| With[{mp = (Plus @@ l)/Length[l], h = Append[#, 
First[#]]&[l]},
|       MapThread[Polygon[Join[#1, Reverse[#2]]]&,
|      {Partition[h, 2, 1], Partition[mp + 0.8(# - 
mp)& /@ h, 2, 1]}]];
|
| makeLine[l_] := Line[Append[l, First[l]]];
|
| Show[Graphics3D[If[faceShape === Polygon, 
makeHole[#], makeLine[#]]& /@
| Join[{Table[N[{Cos[\[CurlyPhi]], 
Sin[\[CurlyPhi]], 0}], {\[CurlyPhi], 0, 2Pi - 
2Pi/n, 2Pi/n}]},
|
| If[iter > 0, Flatten[NestList[myUnion[argch /@ 
(\[ScriptCapitalR] /@
| Flatten[Join[allm /@ #], 1])]&, Join[argch /@ 
(\[ScriptCapitalR] /@ #)]&[
|    Table[Table[N[{Cos[\[CurlyPhi]], 
Sin[\[CurlyPhi]], 0}],
|                 {\[CurlyPhi], \[CurlyPhi]0, 
\[CurlyPhi]0 + 2Pi - 2Pi/n, 2Pi/n}],
|          {\[CurlyPhi]0, 0, 2Pi - 2Pi/n, 
2Pi/n}]], iter - 1], 1], {}]]], opts]]
|
| In[2]:= g = GluedPolygons[3, 0.729729, 4, 
Polygon,
| Boxed -> False,
| SphericalRegion -> True,
| ViewPoint->{1.300, -2.400, 2.000},
| DisplayFunction -> Identity];
|
| In[3]:= Show[g, DisplayFunction -> 
$DisplayFunction]
|
| -- 
| The Mathematica Wiki: 
http://www.mathematica-users.org/
| Math for Comp Sci 
http://www.ifi.unizh.ch/math/bmwcs/master.html
| Math for the WWW: http://www.w3.org/Math/
| 



  • Prev by Date: Re: A question about algebraic numbers using Mathematica
  • Next by Date: Re: Re: Types in Mathematica
  • Previous by thread: Re: FixedPoint stops "when elements no longer change"?
  • Next by thread: Types in Mathematica, a practical example