Like geodesic, but with square faces

73 views
Skip to first unread message

B R S Recht

unread,
May 24, 2017, 9:55:30 PM5/24/17
to antiprism
Quiet around here lately.

One of the things I've developed in my antitile package is something like what geodesic does, but using quadrilateral faces instead of triangles. I've attached two off files created that way, from subdividing a cube. The command lines to generate them are:

sgs.py data/cube.off -a 4 -b 3 | canonical | off_color -v M -f M -m data/group_colors.txt > cube_4_3.off

sgs.py data/cube.off -a 5 | canonical | off_color -v M -f M -m data/group_colors.txt > cube_5_0.off


where sgs.py comes from the antitile package. 

Is this new? I can't find anything in the literature resembling "geodesic subdivision but with quadrilaterals", but I don't have university library access anymore so I'm limited in what I can dig up. I guess since the geodesic dome people care about buildable structures, and quads aren't a stable shape like triangles, nobody from that cohort would have delved into it.

-brsr
cube_4_3.off
cube_5_0.off

Roger Kaufman

unread,
May 25, 2017, 10:50:37 AM5/25/17
to anti...@googlegroups.com
Hi,


On 5/24/2017 9:55 PM, B R S Recht wrote:
One of the things I've developed in my antitile package is something like what geodesic does, but using quadrilateral faces instead of triangles. I've attached two off files created that way, from subdividing a cube. The command lines to generate them are

I've tried to install this using the pip3 install command you give on the page. The files install under ~/.local. If I go into /bin I can run some of the commands. Is there something to add to my path statement?

Roger

Adrian Rossiter

unread,
May 25, 2017, 11:24:10 AM5/25/17
to antiprism
Hi brsr

On Wed, 24 May 2017, B R S Recht wrote:
> Is this new? I can't find anything in the literature resembling "geodesic
> subdivision but with quadrilaterals", but I don't have university library
> access anymore so I'm limited in what I can dig up. I guess since the
> geodesic dome people care about buildable structures, and quads aren't a
> stable shape like triangles, nobody from that cohort would have delved into
> it.

Nice models. I started adding geodesic quads into Antiprism
before but I found that there were issues assigning faces
where the base model had both triangular and quadrilateral faces,
and decided to leave it for some other time... I posted about the
issue here

https://groups.google.com/d/msg/antiprism/iCdh8BCYcec/LVqJy4umAgAJ

Adrian.
--
Adrian Rossiter
adr...@antiprism.com
http://antiprism.com/adrian

Adrian Rossiter

unread,
May 25, 2017, 12:04:46 PM5/25/17
to anti...@googlegroups.com
Hi Roger

On Thu, 25 May 2017, Roger Kaufman wrote:
> On 5/24/2017 9:55 PM, B R S Recht wrote:
>> <https://github.com/brsr/antitile> is something like what geodesic does,
...
> I've tried to install this using the pip3 install command you give on the
> page. The files install under ~/.local. If I go into /bin I can run some of
> the commands. Is there something to add to my path statement?

You could add ~/.local/bin to your PATH (in .bashrc), otherwise, if
you install with 'sudo pip3 ...' the programs will hopefully end up in
/usr/local/bin (they do here), which might already be on your PATH.

Roger Kaufman

unread,
May 25, 2017, 4:51:00 PM5/25/17
to anti...@googlegroups.com
Hi brsr,

I installed it using sudo and have global access to the commands now. When I try using view_off.py I get an error. I might need an additional package, but I can just use antiview too.

unitile2d 2 -s m -w 4 -l 1 | sgs.py -a 2 -b 2 -n | view_off.py

Traceback (most recent call last):
  File "/usr/lib/python3.5/tkinter/__init__.py", line 36, in <module>
    import _tkinter
ImportError: No module named '_tkinter'


When I try cellular I get seems like a lot of identical OFF files.
sgs.py -a 5 -b 3 cube.off | canonical | off_color test.off -f n | cellular.py -v -b=3 -s=2,3

I see they use color map indexes. So using a map in antiview reveals the colors. This would make a nice animation.

antiview -m compound cellular045.off


This command won't work without supporting files

sgs.py -a 5 -b 3 icosahedron.off | off_color -v M -m group_color.txt | pol_recip | view_off.py

Roger

B R S Recht

unread,
May 25, 2017, 8:11:56 PM5/25/17
to antiprism, vortexs...@interocitors.com
Roger,

On Thursday, May 25, 2017 at 4:51:00 PM UTC-4, Roger Kaufman wrote:
Hi brsr,

I installed it using sudo and have global access to the commands now. When I try using view_off.py I get an error. I might need an additional package, but I can just use antiview too.

unitile2d 2 -s m -w 4 -l 1 | sgs.py -a 2 -b 2 -n | view_off.py

Traceback (most recent call last):
  File "/usr/lib/python3.5/tkinter/__init__.py", line 36, in <module>
    import _tkinter
ImportError: No module named '_tkinter'

tkinter is part of the Python standard library, but sometimes it's packaged without it. Depending on which OS/distribution you're on, you might need to install the package tkinter or python3-tkinter or something like that. It's also possible to make matplotlib (which is what depends on tkinter here) run in headless mode: see https://github.com/matplotlib/matplotlib/issues/7115/. Or, just use antiview.
 
When I try cellular I get seems like a lot of identical OFF files.
sgs.py -a 5 -b 3 cube.off | canonical | off_color test.off -f n | cellular.py -v -b=3 -s=2,3

I see they use color map indexes. So using a map in antiview reveals the colors. This would make a nice animation.  

antiview -m compound cellular045.off 

Yup, it produces an OFF file for each step of the cellular automata. The OFF files will be the same except for the face (or vertex) colors. The color index 0 is dead, and 1 is alive. cellular.py should detect when it has reached steady state or started oscillating, so you shouldn't have (many) exact duplicates.  


This command won't work without supporting files

sgs.py -a 5 -b 3 icosahedron.off | off_color -v M -m group_color.txt | pol_recip | view_off.py

It's on my todo list to make the installer put the supporting files someplace useful. You might want to clone the repository and work from that instead. 

Roger

Thanks, 

-brsr 

B R S Recht

unread,
May 25, 2017, 8:29:11 PM5/25/17
to antiprism
Looks like I should have been searching Google Groups instead of Google Scholar. Also looks like we ran into a lot of the same problems: I spent a while banging my head against the issue of mixed quad-triangle grids too. 

Can you change the links on https://github.com/antiprism/antiprism_python from my old geogrid project to the new antitile project?
Thanks,

-brsr 

B R S Recht

unread,
May 30, 2017, 7:13:31 PM5/30/17
to antiprism
Adrian,

Can you explain what geodesic -M s (the "geodesic sphere" method) does? My initial interpretation of that was that it's what the geodesic dome people call Method 2, but it gives a different result than what I implemented as method 2 (which I called 'gc' for great circles) in sgs.

Thanks,

-brsr

Adrian Rossiter

unread,
Jun 1, 2017, 4:43:22 AM6/1/17
to antiprism
Hi brsr

On Tue, 30 May 2017, B R S Recht wrote:
> Can you explain what geodesic -M s (the "geodesic sphere" method) does? My
> initial interpretation of that was that it's what the geodesic dome people
> call Method 2, but it gives a different result than what I implemented as
> method 2 (which I called 'gc' for great circles) in sgs.

The base triangle edges are divided in equal-arc divisions. This is used
to make a triangular grid on the sphere. The sets of three great circle
lines whose intersection(s) will determine a geodesic point don't
generally meet in a single point. Instead, the point is calculated by
finding the three intersections of the lines taken in pairs (giving the
three "window" vertices), and the final point is the centroid of these (in
3D space) projected back onto the sphere.

However, the geodesic.py program in antiprism_python caclulates the
"window" vertices on the original plane triangle, rather than on the
sphere, and so gives slightly different results to geodesic -M s. E.g.

geodesic -c 1,2 ico | off_query -I 42 Vc
42,0.30399641655807369 0.25659349736242071 0.91746714155394771

geodesic.py -c 2,1 | off_trans -R 0,0,90 | off_query -I 54 Vc
54,0.30398035920413508 0.25665535665871531 0.91745515918572973

The intention in these programs is just a "reasonable" symmetric
equal edge-arc division. So, for example, the incircle centre of the
spherical "window" would also have been fine for the geodesic vertex.

Adrian.

P.S. I have updated the links in antiprism_python to point to the
antitile repository.

B R S Recht

unread,
Jun 6, 2017, 3:47:23 PM6/6/17
to antiprism
Thanks for updating the links.

geodesic gives better results than what I implemented, which is why I'm so interested in the difference here. What you're describing sounds like what I did, so there must be some little detail that's off. We do get the same result for Class I subdivisions. My current theory is that we assign the edge points slightly differently for Class II and III.

The attached files show (4,0), (3,1), and (2,2) subdivision on an octahedral face, in a face-centered view... wondering how this looks to you?

-brsr
gc_4_0.png
gc_3_1.png
gc_2_2.png

Adrian Rossiter

unread,
Jun 8, 2017, 3:28:13 AM6/8/17
to antiprism
Hi brsr
In your (3, 1) image the "windows" are being formed by great circles
aligned according to the (3, 1) pattern. The 'geodesic' program doesn't
use a construction like that. Instead, it constructs a Class I grid of
suitable size, and the final points are found by stepping around the grid
according to the pattern specification. There are more details in the
notes for 'geodesic'

http://www.antiprism.com/programs/geodesic.html#notes

In the case of the (3, 1) model, the grid size is 3^2 + 3*1 + 1^2 = 13,
and you can see in the following command that the (3, 1) model shares
vertices with the F13 Class I model [image attached]

off_color -e yellow std_ico | geodesic -f 13 | off_color -E I -e white | off_util -s | antiview -E red -e 0.005 -v 0.012 - std_geo_3_1

Adrian.
geo_1_3_with_grid.png

B R S Recht

unread,
Jun 12, 2017, 12:03:56 PM6/12/17
to antiprism
Ah, so the vertices are a subset of the vertices in a larger Class I geodesic polyhedron. That's the piece I was missing. Thanks.

-brsr

Roger Kaufman

unread,
Jun 15, 2017, 1:18:16 PM6/15/17
to anti...@googlegroups.com
Hi brsr,

I animated a cellular. I did this using a rendition of the example on
your page but using antiprism commands. Previous off files should be
cleared since the total number is variable.

off_util cube | sgs.py -a 5 -b 3 | canonical | off_color -f n |
cellular.py -v -b=3 -s=2,3

This one had 60 frames. I'm not sure what the colored vertices are.


The pov and png files where generated with a python script. The number
of frames needs to be adjusted (possible hardcoding?).

#!/usr/bin/python

import os

num_frames = 61

for i in range(1, num_frames):
os.system("off2pov -m compound -v 0.02 -E lightgrey -o
panim1_%03d.pov cellular%03d.off" %(i, i))
os.system("povray -D +a +W640 +H480
declare=AspectRatio=1.33333333333333333 panim1_%03d.pov" % i)


Then animated with ImageMagick using a bash script.

#!/bin/bash -x

convert -verbose \
-delay 15 panim1_*.png \
anim.gif


The result is attached.

Roger





cellular.gif

B R S Recht

unread,
Jun 16, 2017, 10:22:21 PM6/16/17
to antiprism, vortexs...@interocitors.com
Cool!

sgs.py assigns color indexes to faces and vertices in a way that resembles the images of geodesic spheres (and, dually, Goldberg polyhedra) Tom Ruen put up on Wikipedia. cellular.py uses the color indexes in the input OFF file as the initial state, but if the faces are all one color it overwrites that with a random state. off_color -f n overwrites the faces, but not the vertices. For this animation you might want to overwrite the vertices with a single color. Or, you might want to see how it looks if you hide the edges and vertices.

-brsr

Roger Kaufman

unread,
Jun 19, 2017, 12:45:14 PM6/19/17
to anti...@googlegroups.com
Hi brsr and Adrian,

This command doesn't color the vertices, but it colors the edges.

antiview -m compound -v 0.02 -e 0.02 -E black -V black cellular001.off

If we remove the -m map parameter then it works to color the vertices black.

antiview -v 0.02 -e 0.02 -E black -V black cellular001.off

I found this when I was trying to generate a model with thin black edges. It looks better because showing with no edges makes some face edges hard to see. The command using a width of 0.002 is too small to show the colors still exist.

I would like to figure out how to break out of the python script with a keystroke. Otherwise it take holding the ctrl-c down until the loop completes. I have tried solutions given on the web but they don't work in for loops.

It should be possible to find the count of the maximum cellular.off file which needs to be changed based on situation. But it might work better to make the loop a large number and break out when a file doesn't exist.

Roger

#!/usr/bin/python

import os

num_frames = 92


for i in range(1, num_frames):
  os.system("off2pov -m compound -v 0.002 -e 0.002 -E black -V black -o panim1_%03d.pov cellular%03d.off" %(i, i))

  os.system("povray -D +a +W640 +H480 declare=AspectRatio=1.33333333333333333 panim1_%03d.pov" % i)


--
Antiprism Site: http://www.antiprism.com
---
You received this message because you are subscribed to the Google Groups "antiprism" group.
To unsubscribe from this group and stop receiving emails from it, send an email to antiprism+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/antiprism/3fc77ca5-f3d4-4f11-bac2-2c7aa5354912%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

cellular.gif

Adrian Rossiter

unread,
Jun 19, 2017, 2:21:04 PM6/19/17
to anti...@googlegroups.com
Hi Roger

On Mon, 19 Jun 2017, Roger Kaufman wrote:
> I would like to figure out how to break out of the python script with a
> keystroke. Otherwise it take holding the ctrl-c down until the loop
> completes. I have tried solutions given on the web but they don't work in for
> loops.

I think the problem with the animation scripts is that the binary programs
eat up all the CTRL-Cs, and the odds of one arriving while running Python
code is low. I have always lived with it, but now that you mention it
a fairly easy solution is just to add a short sleep to the loop

import time
...
for i in range(1, num_frames):
...
print("waiting...")
time.sleep(1)

The loop can now be exited by pressing CTRL-C when the prompt appears.
Reply all
Reply to author
Forward
0 new messages