Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cam dimitris75 improvements #76

Merged
merged 9 commits into from
Jul 3, 2024
26 changes: 15 additions & 11 deletions src/Mod/CAM/App/Area.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1639,9 +1639,7 @@ std::vector<shared_ptr<Area> > Area::makeSections(
if (hitMin) continue;
hitMin = true;
double zNew = zMin + myParams.SectionTolerance;
//Silence the warning if _heights is not empty
if (_heights.empty() && FC_LOG_INSTANCE.isEnabled(FC_LOGLEVEL_LOG))
AREA_WARN("hit bottom " << z << ',' << zMin << ',' << zNew);
//AREA_WARN("hit bottom " << z << ',' << zMin << ',' << zNew);
z = zNew;
}
else if (zMax - z < myParams.SectionTolerance) {
Expand Down Expand Up @@ -2282,13 +2280,19 @@ TopoDS_Shape Area::makePocket(int index, PARAM_ARGS(PARAM_FARG, AREA_PARAMS_POCK
pm = SpiralPocketMode;
break;
case Area::PocketModeOffset: {
PARAM_DECLARE_INIT(PARAM_FNAME, AREA_PARAMS_OFFSET);
Offset = -tool_radius - extra_offset - shift;
ExtraPass = -1;
Stepover = -stepover;
LastStepover = -last_stepover;
// make offset and make sure the loop is CW (i.e. inner wires)
return makeOffset(index, PARAM_FIELDS(PARAM_FNAME, AREA_PARAMS_OFFSET), -1, from_center);
if (finishing_offset != true) {
PARAM_DECLARE_INIT(PARAM_FNAME, AREA_PARAMS_OFFSET);
Offset = -tool_radius - extra_offset - shift;
ExtraPass = -1;
Stepover = -stepover;
LastStepover = -last_stepover;
// make offset and make sure the loop is CW (i.e. inner wires)
return makeOffset(index, PARAM_FIELDS(PARAM_FNAME, AREA_PARAMS_OFFSET), -1, from_center);
}
else {
pm = SingleOffsetPocketMode;
break;
}
}case Area::PocketModeZigZagOffset:
pm = ZigZagThenSingleOffsetPocketMode;
break;
Expand Down Expand Up @@ -2354,7 +2358,7 @@ TopoDS_Shape Area::makePocket(int index, PARAM_ARGS(PARAM_FARG, AREA_PARAMS_POCK

if (!done) {
CAreaPocketParams params(
tool_radius, extra_offset, stepover, from_center, pm, angle);
tool_radius, extra_offset, stepover, from_center, finishing_offset, pm, angle);
CArea in(*myArea);
// MakePocketToolPath internally uses libarea Offset which somehow demands
// reorder before input, otherwise nothing is shown.
Expand Down
1 change: 1 addition & 0 deletions src/Mod/CAM/App/AreaParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"Cutter diameter to step over for the last loop when using offset pocket.\n"\
"If =0, use 0.5*ToolRadius.", App::PropertyLength))\
((bool,from_center,FromCenter,false,"Start pocketing from center"))\
((bool,finishing_offset,UseFinishingOffset,false,"Finishing Offset Pass Only"))\
((double,angle,Angle,45,"Pattern angle in degree",App::PropertyAngle))\
((double,angle_shift,AngleShift,0.0,"Pattern angle shift for each section", App::PropertyAngle))\
((double,shift,Shift,0.0,"Pattern shift distance for each section.\n"\
Expand Down
6 changes: 3 additions & 3 deletions src/Mod/CAM/App/AreaPyImp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static PyObject * areaAbort(PyObject *, PyObject *args, PyObject *kwd) {

static PyObject * areaSetParams(PyObject *, PyObject *args, PyObject *kwd) {

static const std::array<const char *, 43> kwlist {PARAM_FIELD_STRINGS(NAME,AREA_PARAMS_STATIC_CONF),nullptr};
static const std::array<const char *, 44> kwlist {PARAM_FIELD_STRINGS(NAME,AREA_PARAMS_STATIC_CONF),nullptr};

if(args && PySequence_Size(args)>0)
PyErr_SetString(PyExc_ValueError,"Non-keyword argument is not supported");
Expand Down Expand Up @@ -335,7 +335,7 @@ PyObject* AreaPy::makeOffset(PyObject *args, PyObject *keywds)

PyObject* AreaPy::makePocket(PyObject *args, PyObject *keywds)
{
static const std::array<const char *, 11> kwlist {"index",PARAM_FIELD_STRINGS(ARG,AREA_PARAMS_POCKET), nullptr};
static const std::array<const char *, 12> kwlist {"index",PARAM_FIELD_STRINGS(ARG,AREA_PARAMS_POCKET), nullptr};
short index = -1;

PARAM_PY_DECLARE_INIT(PARAM_FARG,AREA_PARAMS_POCKET)
Expand Down Expand Up @@ -477,7 +477,7 @@ PyObject* AreaPy::setDefaultParams(PyObject *, PyObject *)

PyObject* AreaPy::setParams(PyObject *args, PyObject *keywds)
{
static const std::array<const char *, 43> kwlist {PARAM_FIELD_STRINGS(NAME,AREA_PARAMS_CONF),nullptr};
static const std::array<const char *, 44> kwlist {PARAM_FIELD_STRINGS(NAME,AREA_PARAMS_CONF),nullptr};

//Declare variables defined in the NAME field of the CONF parameter list
PARAM_PY_DECLARE(PARAM_FNAME,AREA_PARAMS_CONF);
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/CAM/App/FeatureAreaPyImp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ PyObject* FeatureAreaPy::getArea(PyObject *args)

PyObject* FeatureAreaPy::setParams(PyObject *args, PyObject *keywds)
{
static const std::array<const char *, 43> kwlist {PARAM_FIELD_STRINGS(NAME,AREA_PARAMS_CONF),nullptr};
static const std::array<const char *, 44> kwlist {PARAM_FIELD_STRINGS(NAME,AREA_PARAMS_CONF),nullptr};

//Declare variables defined in the NAME field of the CONF parameter list
PARAM_PY_DECLARE(PARAM_FNAME,AREA_PARAMS_CONF);
Expand Down
11 changes: 9 additions & 2 deletions src/Mod/CAM/Gui/Resources/panels/DressUpLeadInOutEdit.ui
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<property name="toolTip">
<string>length or radius of the Lead-in</string>
</property>
<property name="minimum">
<property name="minimum" stdset="0">
<double>0.100000000000000</double>
</property>
<property name="unit" stdset="0">
Expand All @@ -92,6 +92,13 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="chkReverseDir">
<property name="text">
<string>Reverse Direction</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
Expand Down Expand Up @@ -141,7 +148,7 @@
<property name="toolTip">
<string>length or radius of the Lead-out</string>
</property>
<property name="minimum">
<property name="minimum" stdset="0">
<double>0.100000000000000</double>
</property>
<property name="unit" stdset="0">
Expand Down
12 changes: 9 additions & 3 deletions src/Mod/CAM/Gui/Resources/panels/PageOpPocketExtEdit.ui
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,20 @@
<string>Extend Corners</string>
</property>
<property name="checked">
<bool>true</bool>
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label">
<widget class="QCheckBox" name="independentExtensions">
<property name="toolTip">
<string>Extend Edges Independently.</string>
</property>
<property name="text">
<string>Default Length</string>
<string>Extend Edges Ind</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
Expand Down
Loading
Loading