Message 1 of 4

Not applicable
01-22-2017
03:16 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
(defun c:icosahedron () (setq X 0.525731112119133606) (setq Z 0.850650808352039932) (setq vertices (list (* X -1) 0.0 Z X 0.0 Z (* X -1) 0.0 (* Z -1) X 0.0 (* Z -1) 0.0 Z X 0.0 Z (* X -1) 0.0 (* Z -1) X 0.0 (* Z -1) (* X -1) Z X 0.0 (* Z -1) X 0.0 Z (* X -1) 0.0 (* Z -1) (* X -1) 0.0 ) ) (setq indices (list 0 4 1 0 9 4 9 5 4 4 5 8 4 8 1 8 10 1 8 3 10 5 3 8 5 2 3 2 7 3 7 10 3 7 6 10 7 11 6 11 0 6 0 1 6 6 1 10 9 0 11 9 11 2 9 2 5 7 2 11 ) ) ;;A function that uses entmakex to draw a point (defun Point (pt) (entmakex (list (cons 0 "POINT") (cons 10 pt)) ) ) ;;A function that draws a 3DFace. Pass in four xyz point lists (defun 3DFace (p1 p2 p3 p4) (entmakex (list (cons 0 "3DFACE") (cons 10 p1) (cons 11 p2) (cons 12 p3) (cons 13 p4) ) ) ) (setq i 0) (while (< i 20) (setq ix (+ i 0)) (setq iy (+ i 1)) (setq iz (+ i 2)) (setq i1 (nth ix indices)) (setq i2 (nth iy indices)) (setq i3 (nth iz indices)) (setq v1 (nth i1 vertices)) (setq v2 (nth i2 vertices)) (setq v3 (nth i3 vertices)) (3DFace v1 v2 v3 v1) (setq i (+ i 3)) ) (princ "done...") )
In regards to the following code which I have transcribed from:
http://glprogramming.com/red/chapter02.html
There seems to be a problem processing the vertices that are negated (or have a value less than zero). Does anyone know how to work around this problem I keep getting a DXF BAD GROUP CODE 10 error. Thank you.
Solved! Go to Solution.