Skip to content

Commit

Permalink
Zero arc precision settings fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Denvi committed Nov 27, 2015
1 parent 8b0b8f2 commit e15634a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
18 changes: 17 additions & 1 deletion frmsettings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ QGroupBox {
<rect>
<x>0</x>
<y>-274</y>
<width>386</width>
<width>399</width>
<height>1184</height>
</rect>
</property>
Expand Down Expand Up @@ -503,6 +503,22 @@ padding-top: 3;</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_15">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>6</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QRadioButton" name="radArcDegreeMode">
<property name="text">
Expand Down
9 changes: 4 additions & 5 deletions gcodepreprocessorutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,16 +455,15 @@ QList<QVector3D> GcodePreprocessorUtils::generatePointsAlongArcBDring(PointSegme

int numPoints;

if (arcDegreeMode) numPoints = qMax(1.0, sweep / (M_PI * arcPrecision / 180));
else {
if (arcDegreeMode && arcPrecision > 0) {
numPoints = qMax(1.0, sweep / (M_PI * arcPrecision / 180));
} else {
if (arcPrecision <= 0 && minArcLength > 0) {
arcPrecision = (sweep * radius) / minArcLength;
arcPrecision = minArcLength;
}
numPoints = (int)ceil(arcLength/arcPrecision);
}

qDebug() << "arcPrecision" << arcPrecision << arcDegreeMode << numPoints;

return generatePointsAlongArcBDring(plane, start, end, center, clockwise, radius, startAngle, sweep, numPoints);
}

Expand Down
2 changes: 1 addition & 1 deletion gcodeviewparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ QList<LineSegment *> GcodeViewParse::getLinesFromParser(GcodeParser *gp, double
{
QList<PointSegment*> psl = gp->getPointSegmentList();
// For a line segment list ALL arcs must be converted to lines.
double minArcLength = 0;
double minArcLength = 0.1;

// Point3d start = null;
// Point3d end = null;
Expand Down

0 comments on commit e15634a

Please sign in to comment.