Re: Crashing problem with 3d IFS program
- To: mathgroup at smc.vnet.net
- Subject: [mg123569] Re: Crashing problem with 3d IFS program
- From: Heike Gramberg <heike.gramberg at gmail.com>
- Date: Sun, 11 Dec 2011 03:49:01 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <jbq3b6$ihl$1@smc.vnet.net> <201112101228.HAA19271@smc.vnet.net>
It seems that Draw in your package uses ParametricPlot3D to plot the shapes. Since the shapes are basically just polyhedra, you only need to know the coordinates of the vertices of the shapes. You can then use Polygon to draw the faces, e.g. you could do something like plot[Manifold[p_, c___]] := Graphics3D@Module[{pp, combis, img}, If[ArrayDepth[p] == 1, pp = {p}, pp = p]; combis = Tuples[{c}[[All, {2, 3}]]]; With[{ faces = {{1, 5, 6, 2}, {1, 2, 4, 3}, {1, 3, 7, 5}, {8, 7, 3, 4}, {8, 4, 2, 6}, {8, 6, 5, 7}}}, Table[img = k /. (Thread[{c}[[All, 1]] -> #] & /@ combis); GraphicsComplex[img, Polygon /@ faces], {k, pp}]]] Then to plot g, g2, etc. you could do (* copy-pasted from previous post *) OneStepIFS[ifs_][s_] := Flatten[Map[Through[ifs[#]] &, s], 1] IterateIFS[ifs_, init_, n_] := Nest[OneStepIFS[ifs], {init}, n] ManifoldIFS[ifs_, Manifold[p_, c___], n_] := Manifold[IterateIFS[ifs, p, n], c] Clear[Sierpinsky3D, Sierpinsky3DIFS, gr] pieces = N[{{0, 0, 0}, {0, 0, 1}, {0, 0, 2}, {0, 1, 0}, {0, 1, 2}, {0, 2, 0}, {0, 2, 1}, {0, 2, 2}, {1, 1/2, 0}, {1, 1/2, 2}, {1, 1.5, 0}, {1, 1.5, 2}, {2, 1, 0}, {2, 1, 1}, {2, 1, 2}, {-1, 0, 1/2}, {-1, 2, 1/2}, {-1, 0, 1.5}, {-1, 2, 1.5}, {-2, 0, 1}, {-2, 1, 1}, {-2, 2, 1}}/4]; Sierpinsky3D[n_][v_] := (1/3)*v + pieces[[n]] Sierpinsky3DIFS := Array[Sierpinsky3D, Length[pieces]] gr = plot[ ManifoldIFS[Sierpinsky3DIFS, Manifold[{u/1.01, (1 - u) v + 1, 2*w/1.01}/(4/3)/2, {u, 0, 1}, {v, 0, 1}, {w, 0, 1}], 2]]; gr3 = plot[ ManifoldIFS[Sierpinsky3DIFS, Manifold[{u/1.01, -(1 - u) v + 1, 2*w/1.01}/(4/3)/2, {u, 0, 1}, {v, 0, 1}, {w, 0, 1}], 2]]; gr2 = plot[ ManifoldIFS[Sierpinsky3DIFS, Manifold[{-u/1.01, 2*w/1.01, 1 + (1 - u) v}/(4/3)/2, {u, 0, 1}, {v, 0, 1}, {w, 0, 1}], 2]]; gr4 = plot[ ManifoldIFS[Sierpinsky3DIFS, Manifold[{-u/1.01, 2*w/1.01, 1 - (1 - u) v}/(4/3)/2, {u, 0, 1}, {v, 0, 1}, {w, 0, 1}], 2]]; gw = Show[{gr, gr2, gr3, gr4}, PlotRange -> All] Heike On 10 Dec 2011, at 13:28, Roger Bagula wrote: > Well with a little effort I got the second level and solved the > problem. > These IFS take too much memory. I can get one or two at a time, > but all four just takes too much memory for Mathematica to handle . > I looked in the preferences, but I don't see any way to > increase the Kernal memory to several GB gegabytes? > Anyway the models are no good for 3d printing at that level of memory: > 879 megabytes for an obj 3d model > 429 megabytes for an stl 3d model > 188.4 for a 3ds 3d model. > > >
- References:
- Re: Crashing problem with 3d IFS program
- From: Roger Bagula <roger.bagula@gmail.com>
- Re: Crashing problem with 3d IFS program