mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-15 18:58:00 -06:00
Add "2D Lattice" fill pattern for lightweight aircraft structures (#8293)
* Add 2D lattice infill pattern * Add state invalidation behavior for lattice infill angles * Update SurfaceFillParams methods to account for lattice infill angles --------- Co-authored-by: SoftFever <softfeverever@gmail.com> Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
This commit is contained in:
parent
c21b044a9c
commit
5145707801
13 changed files with 89 additions and 5 deletions
|
@ -3002,6 +3002,23 @@ Polylines FillGrid::fill_surface(const Surface *surface, const FillParams ¶m
|
|||
return polylines_out;
|
||||
}
|
||||
|
||||
Polylines Fill2DLattice::fill_surface(const Surface *surface, const FillParams ¶ms)
|
||||
{
|
||||
Polylines polylines_out;
|
||||
coordf_t dx1 = tan(Geometry::deg2rad(params.lattice_angle_1)) * z;
|
||||
coordf_t dx2 = tan(Geometry::deg2rad(params.lattice_angle_2)) * z;
|
||||
if (! this->fill_surface_by_multilines(
|
||||
surface, params,
|
||||
{ { float(M_PI / 2.), float(dx1) }, { float(M_PI / 2.), float(dx2) } },
|
||||
polylines_out))
|
||||
BOOST_LOG_TRIVIAL(error) << "Fill2DLattice::fill_surface() failed to fill a region.";
|
||||
|
||||
if (this->layer_id % 2 == 1)
|
||||
for (int i = 0; i < polylines_out.size(); i++)
|
||||
std::reverse(polylines_out[i].begin(), polylines_out[i].end());
|
||||
return polylines_out;
|
||||
}
|
||||
|
||||
Polylines FillTriangles::fill_surface(const Surface *surface, const FillParams ¶ms)
|
||||
{
|
||||
Polylines polylines_out;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue