Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
#include <noether_tpp/serialization.h>
#include <QGroupBox>

static const std::string POINT_SPACING_KEY = "point_spacing";
static const std::string MIN_HOLE_SIZE_KEY = "min_hole_size";
static const std::string SEARCH_RADIUS_KEY = "search_radius";
static const std::string MIN_SEGMENT_SIZE_KEY = "min_segment_size";
static const std::string BIDIRECTIONAL_KEY = "bidirectional";

namespace noether
Expand All @@ -25,11 +21,6 @@ void PlaneSlicerRasterPlannerWidget::configure(const YAML::Node& config)
{
RasterPlannerWidget::configure(config);

ui_plane_slicer_->double_spin_box_point_spacing->setValue(YAML::getMember<double>(config, POINT_SPACING_KEY));
ui_plane_slicer_->double_spin_box_minimum_hole_size->setValue(YAML::getMember<double>(config, MIN_HOLE_SIZE_KEY));
ui_plane_slicer_->double_spin_box_search_radius->setValue(YAML::getMember<double>(config, SEARCH_RADIUS_KEY));
ui_plane_slicer_->double_spin_box_min_segment_size->setValue(YAML::getMember<double>(config, MIN_SEGMENT_SIZE_KEY));

// Optionally get bidirectional parameter to maintain backwards compatibility
try
{
Expand All @@ -44,10 +35,6 @@ void PlaneSlicerRasterPlannerWidget::save(YAML::Node& config) const
{
config["name"] = "PlaneSlicer";
RasterPlannerWidget::save(config);
config[POINT_SPACING_KEY] = ui_plane_slicer_->double_spin_box_point_spacing->value();
config[MIN_HOLE_SIZE_KEY] = ui_plane_slicer_->double_spin_box_minimum_hole_size->value();
config[SEARCH_RADIUS_KEY] = ui_plane_slicer_->double_spin_box_search_radius->value();
config[MIN_SEGMENT_SIZE_KEY] = ui_plane_slicer_->double_spin_box_min_segment_size->value();
config[BIDIRECTIONAL_KEY] = ui_plane_slicer_->check_box_bidirectional->isChecked();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,104 +15,6 @@
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_point_spacing">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Distance between tool path waypoints on a raster line&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Point Spacing</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="noether::DistanceDoubleSpinBox" name="double_spin_box_point_spacing">
<property name="decimals">
<number>3</number>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="maximum">
<double>100.000000000000000</double>
</property>
<property name="value">
<double>0.025000000000000</double>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_min_hole_size">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The size of the smallest hole that the tool path planner should not jump over&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Minimum Hole Size</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="noether::DistanceDoubleSpinBox" name="double_spin_box_minimum_hole_size">
<property name="decimals">
<number>3</number>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="maximum">
<double>100.000000000000000</double>
</property>
<property name="value">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_search_radius">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Radius with which to estimate mesh normals&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Search Radius</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="noether::DistanceDoubleSpinBox" name="double_spin_box_search_radius">
<property name="decimals">
<number>3</number>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_min_segment_size">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Tool path segments shorter than this length will not be included&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Min Segment Size</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="noether::DistanceDoubleSpinBox" name="double_spin_box_min_segment_size">
<property name="decimals">
<number>3</number>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Generate rasters in the direction of the cut plane normal and its negation&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
Expand All @@ -122,7 +24,7 @@
</property>
</widget>
</item>
<item row="4" column="1">
<item row="0" column="1">
<widget class="QCheckBox" name="check_box_bidirectional">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
Expand All @@ -143,19 +45,6 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>noether::DistanceDoubleSpinBox</class>
<extends>QDoubleSpinBox</extends>
<header location="global">noether_gui/widgets/distance_double_spin_box.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>double_spin_box_point_spacing</tabstop>
<tabstop>double_spin_box_minimum_hole_size</tabstop>
<tabstop>double_spin_box_search_radius</tabstop>
<tabstop>double_spin_box_min_segment_size</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace noether
{
/**
* @ingroup raster_planners
* @brief An implementation of the Raster Planner using a series of parallel cutting planes.
* @brief An implementation of RasterPlanner using a series of parallel cutting planes.
* @details This implementation works best on approximately planar parts.
* The direction generator defines the direction of the raster cut.
* The cut normal (i.e., the raster step direction) is defined by the cross product of the cut direction and the
Expand All @@ -35,10 +35,6 @@ class PlaneSlicerRasterPlanner : public RasterPlanner
public:
PlaneSlicerRasterPlanner(DirectionGenerator::ConstPtr dir_gen, OriginGenerator::ConstPtr origin_gen);

void setPointSpacing(const double point_spacing);
void setMinHoleSize(const double min_hole_size);
void setSearchRadius(const double search_radius);
void setMinSegmentSize(const double min_segment_size);
void generateRastersBidirectionally(const bool bidirectional);

protected:
Expand All @@ -49,18 +45,9 @@ class PlaneSlicerRasterPlanner : public RasterPlanner
*/
ToolPaths planImpl(const pcl::PolygonMesh& mesh) const;

/** @brief Distance between waypoints on the same raster line (m) */
double point_spacing_;
/** @brief Minimum size of hole in a mesh for which the planner should split a raster line that
* crosses over the hole into multiple segments */
double min_hole_size_;
/** @brief Flag indicating whether rasters should be generated in the direction of both the cut normal and its
* negation */
bool bidirectional_ = true;
/** @brief Minimum length of valid segment (m) */
double min_segment_size_;
/** @brief Search radius for calculating normals (m) */
double search_radius_;
};

} // namespace noether
4 changes: 0 additions & 4 deletions noether_tpp/src/plugins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,6 @@ struct Plugin_PlaneSlicerRasterPlanner : public Plugin<ToolPathPlanner>

auto tpp = std::make_unique<PlaneSlicerRasterPlanner>(std::move(dir_gen), std::move(origin_gen));
tpp->setLineSpacing(YAML::getMember<double>(config, "line_spacing"));
tpp->setMinHoleSize(YAML::getMember<double>(config, "min_hole_size"));
tpp->setPointSpacing(YAML::getMember<double>(config, "point_spacing"));
tpp->setMinSegmentSize(YAML::getMember<double>(config, "min_segment_size"));
tpp->setSearchRadius(YAML::getMember<double>(config, "search_radius"));
tpp->generateRastersBidirectionally(YAML::getMember<bool>(config, "bidirectional"));

return tpp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#include <noether_tpp/utils.h>
#include <noether_tpp/serialization.h>

#include <numeric>

namespace noether
{
ToolPaths RasterOrganizationModifier::modify(ToolPaths tool_paths) const
Expand All @@ -15,13 +13,11 @@ ToolPaths RasterOrganizationModifier::modify(ToolPaths tool_paths) const
// Sort the waypoints within each tool path segment by their distance along the reference direction
for (ToolPathSegment& segment : tool_path)
{
std::sort(segment.begin(),
segment.end(),
[&segment, &reference_segment_dir](const ToolPathWaypoint& a, const ToolPathWaypoint& b) {
Eigen::Vector3d diff_from_start_b = b.translation() - segment.at(0).translation();
Eigen::Vector3d diff_from_start_a = a.translation() - segment.at(0).translation();
return diff_from_start_a.dot(reference_segment_dir) < diff_from_start_b.dot(reference_segment_dir);
});
const Eigen::Vector3d diff_from_start_end = segment.rbegin()->translation() - segment.begin()->translation();
if (diff_from_start_end.dot(reference_segment_dir) < 0.0)
{
std::reverse(segment.begin(), segment.end());
}
}

// Sort the tool path segments within each tool path by the distance of their first waypoints along the reference
Expand Down
Loading
Loading