Radial dimensions

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Radial dimensions

Ed Richley

I've been having problems with radial dimensions. Basically, they
don't work with arcs. Apparently, radial dimensions can be applied
to both 'arcs' and 'circles', at least that's what I see in imageio.py.

So, here's my (very crude) patch to fix this. I'm sure it can be done
much better, but this at least lets the files open.

Ed



Index: imageio.py
===================================================================
--- imageio.py (revision 2769)
+++ imageio.py (working copy)
@@ -2424,8 +2424,14 @@
     _cid = dim['c']
     del dim['c']
     _lid = id(_cl)
-    assert _cid in map[_lid]['circle'], "Missing circle key %d" % _cid
-    _circ = map[_lid]['circle'][_cid]
+#    assert (_cid in map[_lid]['arc'])|(_cid in map[_lid]['circle']),
"Missing circle key %d" % _cid
+    assert ('arc' in map[_lid])|('circle' in map[_lid]), "Missing circle key
%d" % _cid
+    if 'arc' in map[_lid]:
+        if _cid in map[_lid]['arc']:
+            _circ = map[_lid]['arc'][_cid]
+    elif 'circle' in map[_lid]:
+        if _cid in map[_lid]['circle']:
+            _circ = map[_lid]['circle'][_cid]
     assert 'x' in dim, "Dim missing key 'x': " + `dim`
     _x = dim['x']
     del dim['x']




_______________________________________________
PythonCAD mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/pythoncad