Lagrange
Loading...
Searching...
No Matches
PolylineSweepPath< _VertexArray > Class Template Referencefinal

Create sweep path based on a polyline. More...

#include <lagrange/primitive/legacy/SweepPath.h>

Inheritance diagram for PolylineSweepPath< _VertexArray >:
SweepPath< _VertexArray::Scalar >

Public Types

using Scalar = typename _VertexArray::Scalar
 
using VertexArray = _VertexArray
 
using Parent = SweepPath<Scalar>
 
using Index = Eigen::Index
 
- Public Types inherited from SweepPath< _VertexArray::Scalar >
using Scalar
 
using TransformType
 
using PointType
 

Public Member Functions

 PolylineSweepPath (const VertexArray &polyline)
 Polyline sweep path constructor.
 
void initialize () override
 Generate transformation matrices based on the setting provided.
 
std::unique_ptr< Parentclone () const override
 Create a deep copy of itself.
 
bool is_closed () const override
 Whether the sweep path is closed.
 
bool operator== (const SweepPath< Scalar > &other) const override
 Check if two sweep paths are the same.
 
- Public Member Functions inherited from SweepPath< _VertexArray::Scalar >
size_t get_num_samples () const
 The number of samples used to sample along the sweeping path.
 
void set_num_samples (size_t n)
 Set the number of samples for uniform sampling of the sweeping path.
 
const std::vector< Scalar > & get_samples () const
 Samples are always in ascending order going from 0 to 1.
 
void set_samples (std::vector< Scalar > samples)
 Set the sample points.
 
void add_samples (const std::vector< Scalar > &samples)
 Add samples to the existing samples.
 
const std::vector< TransformType > & get_transforms () const
 Retrieve the transforms generated using initialize().
 
std::vector< TransformType > & get_transforms ()
 
std::vector< Scalar > get_offsets () const
 Retrieve the sampled normal offsets.
 
Scalar get_depth_begin () const
 Start sweeping at certain depth along the path.
 
void set_depth_begin (Scalar depth)
 
Scalar get_depth_end () const
 Stop sweeping at certain depth along the path.
 
void set_depth_end (Scalar depth)
 
Scalar get_twist_begin () const
 Twisting angle at the beginning of the sweep path.
 
void set_twist_begin (Scalar twist)
 
Scalar get_twist_end () const
 Twisting angle at the end of the sweep path.
 
void set_twist_end (Scalar twist)
 
Scalar get_taper_begin () const
 Scaling factor at the beginning of the sweep path.
 
void set_taper_begin (Scalar taper)
 
Scalar get_taper_end () const
 Scaling factor at the beginning of the sweep path.
 
void set_taper_end (Scalar taper)
 
const PointType & get_pivot () const
 Twisting and tapering are all with respect to a pivot point.
 
void set_pivot (const PointType &p)
 
void set_offset_fn (std::function< Scalar(Scalar)> fn)
 Offset function provides a mapping from the relative depth (from 0 to 1) to a normal offset amount (measured in 3D Euclidean distance).
 
bool has_offsets () const
 
void set_normalization_transform (const TransformType &transform)
 Sometimes one may want to sweep a normalized profile curve, and update normalization from time to time.
 
const TransformType & get_normalization_transform () const
 

Protected Member Functions

bool is_polyline_closed () const
 
- Protected Member Functions inherited from SweepPath< _VertexArray::Scalar >
void clone_settings (SweepPath< Scalar > &other) const
 

Additional Inherited Members

- Protected Attributes inherited from SweepPath< _VertexArray::Scalar >
std::vector< TransformType > m_transforms
 
std::vector< Scalar > m_samples
 should be sorted in ascending order from 0 to 1.
 
TransformType m_normalization
 
Scalar m_depth_begin
 
Scalar m_depth_end
 
Scalar m_twist_begin
 
Scalar m_twist_end
 
Scalar m_taper_begin
 
Scalar m_taper_end
 
PointType m_pivot
 
std::function< Scalar(Scalar)> m_offset_fn
 

Detailed Description

template<typename _VertexArray>
class lagrange::primitive::legacy::PolylineSweepPath< _VertexArray >

Create sweep path based on a polyline.

Constructor & Destructor Documentation

◆ PolylineSweepPath()

template<typename _VertexArray>
PolylineSweepPath ( const VertexArray & polyline)
inline

Polyline sweep path constructor.

Parameters
[in]polylineThe polyline path.
Note
A polylline is considered "closed" if the first vertex and the last vertex are the same.
By default, the generated PolylineSweepPath object will cover the entire polyline and transformations are sampled at the vertices on the polyline. The sweep path can be a portion of the polyline by set_depth_begin() and set_depth_end(). The sampling rate can also be changed using set_num_samples().

Member Function Documentation

◆ initialize()

template<typename _VertexArray>
void initialize ( )
inlineoverridevirtual

Generate transformation matrices based on the setting provided.

The generated transforms can be retrieved using get_transforms() method.

Apply normalization, twist and taper transformations to a given transform.

Implements SweepPath< _VertexArray::Scalar >.

◆ clone()

template<typename _VertexArray>
std::unique_ptr< Parent > clone ( ) const
inlineoverridevirtual

Create a deep copy of itself.

Implements SweepPath< _VertexArray::Scalar >.

◆ is_closed()

template<typename _VertexArray>
bool is_closed ( ) const
inlineoverridevirtual

Whether the sweep path is closed.

Implements SweepPath< _VertexArray::Scalar >.

◆ operator==()

template<typename _VertexArray>
bool operator== ( const SweepPath< Scalar > & other) const
inlineoverridevirtual

Check if two sweep paths are the same.

Reimplemented from SweepPath< _VertexArray::Scalar >.

◆ is_polyline_closed()

template<typename _VertexArray>
bool is_polyline_closed ( ) const
inlineprotected
Note
: A closed polyline does not necessarily mean a closed sweep path because the sweep path may not cover the entire polyline depending on the depth settings.

The documentation for this class was generated from the following file: