It appears, that AXIS shows arcs quite good even if they are coarse...
Regards,
Alex.
Accelerate arcs
From: Alexey Starikovskiy <[email protected]>
---
lib/python/rs274/interpret.py | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/python/rs274/interpret.py b/lib/python/rs274/interpret.py
index b37a43e..0a37e14 100644
--- a/lib/python/rs274/interpret.py
+++ b/lib/python/rs274/interpret.py
@@ -84,8 +84,7 @@ class ArcsToSegmentsMixin:
theta2 = math.atan2(n[xyz[1]]-cy, n[xyz[0]]-cx)
# these ought to be the same, but go ahead and display them if not, for debugging
- rad1 = math.hypot(o[xyz[0]]-cx, o[xyz[1]]-cy)
- rad2 = math.hypot(n[xyz[0]]-cx, n[xyz[1]]-cy)
+ rad = math.hypot(o[xyz[0]]-cx, o[xyz[1]]-cy)
if rot < 0:
if theta2 >= theta1: theta2 -= math.pi * 2
@@ -95,11 +94,10 @@ class ArcsToSegmentsMixin:
def interp(low, high):
return low + (high-low) * i / steps
- steps = max(8, int(128 * abs(theta1 - theta2) / math.pi))
+ steps = max(3, int(24 * abs(theta1 - theta2) / math.pi))
p = [0] * 9
for i in range(1, steps):
theta = interp(theta1, theta2)
- rad = interp(rad1, rad2)
p[xyz[0]] = math.cos(theta) * rad + cx
p[xyz[1]] = math.sin(theta) * rad + cy
p[xyz[2]] = interp(o[xyz[2]], n[xyz[2]])
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers