mecamira / dxf2gcode

Automatically exported from code.google.com/p/dxf2gcode
0 stars 0 forks source link

Query - DxfImport/SplineConvert.py #40

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Variable "te" is calculated on line 164 but then immediately reassigned to be 
"tau" (a passed-in parameter) on line 165.  Not sure if this is intentional (in 
which case the first calculation/assignment can be removed) or a bug.

Found while reading down the code so no test case and unsure of the impact.

DxfImport/SplineConvert.py:
157    def calc_active_tolerance_dec(self, tau, arc, Arc0, Arc1):
158        V0 = arc[2].Pa.unit_vector(arc[2].O)
159        Vb = Arc1.Pa.unit_vector(Arc1.O)
160        
161        t_ = (2 * arc[2].r * tau + pow(tau, 2)) / \
162             (2 * (arc[2].r + (arc[2].r + tau) * V0 * Vb))
163        
164        te = arc[2].r + t_ - (Arc0.Pe - (arc[2].O + (t_ * V0))).distance()
165        te = tau

Original issue reported on code.google.com by johninla...@googlemail.com on 26 Dec 2013 at 4:51

GoogleCodeExporter commented 9 years ago
Hi John,
i really don't know wheater it is a bug or not. The whole function is intendet 
to define the accuracy of a biarc during the spline conversion. A Long time ago 
i did write the code but now i don't fully remeber what was the Intension by 
commenting it out. Since the code is working like this a Long time already and 
there is no failure reported linked to this i would suggest to leave it as it 
is. Did you try to comment out the whole line and Import some splines, e.g. 
test.dxf and drake.dxf etc.

Original comment by christian.kohloeffel on 27 Dec 2013 at 2:01

GoogleCodeExporter commented 9 years ago
Hi Christian,

Didn't do any testing yet, just logged it so it wasn't forgotten about.  It
could be that the first piece of logic isn't needed at all now (perhaps the
passed-in value of tau is good enough).

J.

Original comment by johninla...@googlemail.com on 27 Dec 2013 at 5:05