Skip to content

Commit 56ab597

Browse files
committed
update axis to remove/add type
1 parent 8590182 commit 56ab597

File tree

10 files changed

+39
-34
lines changed

10 files changed

+39
-34
lines changed

include/geode/geometry/point.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ namespace geode
7676
[[nodiscard]] std::string string() const;
7777

7878
[[nodiscard]] Point< dimension - 1 > project_point(
79-
geode::local_index_t axis_to_remove ) const;
79+
local_index_t axis_to_remove ) const;
8080

8181
private:
8282
friend class bitsery::Access;

include/geode/mesh/helpers/convert_edged_curve.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ namespace geode
3939
{
4040
[[nodiscard]] std::unique_ptr< EdgedCurve2D >
4141
opengeode_mesh_api convert_edged_curve3d_into_2d(
42-
const EdgedCurve3D& curve3d, index_t axis_to_remove );
42+
const EdgedCurve3D& curve3d, local_index_t axis_to_remove );
4343

4444
[[nodiscard]] std::unique_ptr< EdgedCurve3D > opengeode_mesh_api
4545
convert_edged_curve2d_into_3d( const EdgedCurve2D& curve2d,
46-
index_t axis_to_add,
46+
local_index_t axis_to_add,
4747
double axis_coordinate );
4848

4949
template < index_t dimension >

include/geode/mesh/helpers/convert_point_set.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ namespace geode
3737
{
3838
[[nodiscard]] std::unique_ptr< PointSet2D >
3939
opengeode_mesh_api convert_point_set3d_into_2d(
40-
const PointSet3D& point_set3d, index_t axis_to_remove );
40+
const PointSet3D& point_set3d, local_index_t axis_to_remove );
4141

4242
[[nodiscard]] std::unique_ptr< PointSet3D > opengeode_mesh_api
4343
convert_point_set2d_into_3d( const PointSet2D& point_set2d,
44-
index_t axis_to_add,
44+
local_index_t axis_to_add,
4545
double axis_coordinate );
4646
} // namespace geode

include/geode/mesh/helpers/convert_surface_mesh.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,32 +74,33 @@ namespace geode
7474

7575
[[nodiscard]] std::unique_ptr< SurfaceMesh3D > opengeode_mesh_api
7676
convert_surface_mesh2d_into_3d( const SurfaceMesh2D& surface2d,
77-
index_t axis_to_add,
77+
local_index_t axis_to_add,
7878
double axis_coordinate );
7979

8080
[[nodiscard]] std::unique_ptr< SurfaceMesh2D >
8181
opengeode_mesh_api convert_surface_mesh3d_into_2d(
82-
const SurfaceMesh3D& surface3d, index_t axis_to_remove );
82+
const SurfaceMesh3D& surface3d, local_index_t axis_to_remove );
8383

8484
[[nodiscard]] std::unique_ptr< PolygonalSurface3D >
8585
opengeode_mesh_api convert_polygonal_surface2d_into_3d(
8686
const PolygonalSurface2D& surface2d,
87-
index_t axis_to_add,
87+
local_index_t axis_to_add,
8888
double axis_coordinate );
8989

9090
[[nodiscard]] std::unique_ptr< PolygonalSurface2D >
9191
opengeode_mesh_api convert_polygonal_surface3d_into_2d(
92-
const PolygonalSurface3D& surface3d, index_t axis_to_remove );
92+
const PolygonalSurface3D& surface3d, local_index_t axis_to_remove );
9393

9494
[[nodiscard]] std::unique_ptr< TriangulatedSurface3D >
9595
opengeode_mesh_api convert_triangulated_surface2d_into_3d(
9696
const TriangulatedSurface2D& surface2d,
97-
index_t axis_to_add,
97+
local_index_t axis_to_add,
9898
double axis_coordinate );
9999

100100
[[nodiscard]] std::unique_ptr< TriangulatedSurface2D >
101101
opengeode_mesh_api convert_triangulated_surface3d_into_2d(
102-
const TriangulatedSurface3D& surface3d, index_t axis_to_remove );
102+
const TriangulatedSurface3D& surface3d,
103+
local_index_t axis_to_remove );
103104

104105
template < index_t dimension >
105106
[[nodiscard]] std::unique_ptr< SurfaceMesh< dimension > >

include/geode/mesh/helpers/internal/copy.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ namespace geode
3737
namespace internal
3838
{
3939
template < typename MeshFrom, typename Builder >
40-
void copy_points3d_into_2d(
41-
const MeshFrom& from, Builder& builder, index_t axis_to_remove )
40+
void copy_points3d_into_2d( const MeshFrom& from,
41+
Builder& builder,
42+
local_index_t axis_to_remove )
4243
{
4344
OPENGEODE_EXCEPTION( axis_to_remove < 3,
4445
"[copy_points3d_into_2d] Invalid axis to remove." );
@@ -47,16 +48,15 @@ namespace geode
4748
async::irange( index_t{ 0 }, from.nb_vertices() ),
4849
[&from, &builder, axis_to_remove]( index_t v ) {
4950
const auto& pt_3d = from.point( v );
50-
builder.set_point( v,
51-
Point2D{ { pt_3d.value( axis_to_remove == 0 ? 1 : 0 ),
52-
pt_3d.value( axis_to_remove == 2 ? 1 : 2 ) } } );
51+
builder.set_point(
52+
v, pt_3d.project_point( axis_to_remove ) );
5353
} );
5454
}
5555

5656
template < typename MeshFrom, typename Builder >
5757
void copy_points2d_into_3d( const MeshFrom& from,
5858
Builder& builder,
59-
index_t axis_to_add,
59+
local_index_t axis_to_add,
6060
double axis_coordinate )
6161
{
6262
OPENGEODE_EXCEPTION( axis_to_add < 3,

include/geode/model/helpers/convert_brep_section.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,19 @@ namespace geode
3434

3535
namespace geode
3636
{
37-
[[nodiscard]] std::tuple< Section, ModelCopyMapping > opengeode_model_api
38-
convert_brep_into_section( const BRep& brep, index_t axis_to_remove );
37+
[[nodiscard]] std::tuple< Section, ModelCopyMapping >
38+
opengeode_model_api convert_brep_into_section(
39+
const BRep& brep, local_index_t axis_to_remove );
3940

4041
[[nodiscard]] std::tuple< BRep, ModelCopyMapping >
4142
opengeode_model_api convert_section_into_brep( const Section& section,
42-
index_t axis_to_add,
43+
local_index_t axis_to_add,
4344
double axis_coordinate );
4445

45-
struct opengeode_model_api SectionExtruderOptions
46+
struct SectionExtruderOptions
4647
{
4748
SectionExtruderOptions() = default;
48-
index_t axis_to_extrude{ NO_ID };
49+
local_index_t axis_to_extrude{ NO_LID };
4950
double min_coordinate{ 0. };
5051
double max_coordinate{ 0. };
5152
};

src/geode/mesh/helpers/convert_edged_curve.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ namespace
4848
namespace geode
4949
{
5050
std::unique_ptr< EdgedCurve2D > convert_edged_curve3d_into_2d(
51-
const EdgedCurve3D& curve3d, index_t axis_to_remove )
51+
const EdgedCurve3D& curve3d, local_index_t axis_to_remove )
5252
{
5353
auto curve2d = EdgedCurve2D::create();
5454
auto builder2d = EdgedCurveBuilder2D::create( *curve2d );
@@ -64,7 +64,7 @@ namespace geode
6464

6565
std::unique_ptr< EdgedCurve3D > convert_edged_curve2d_into_3d(
6666
const EdgedCurve2D& curve2d,
67-
index_t axis_to_add,
67+
local_index_t axis_to_add,
6868
double axis_coordinate )
6969
{
7070
auto curve3d = EdgedCurve3D::create();

src/geode/mesh/helpers/convert_point_set.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
namespace geode
3535
{
3636
std::unique_ptr< PointSet2D > convert_point_set3d_into_2d(
37-
const PointSet3D& point_set3d, index_t axis_to_remove )
37+
const PointSet3D& point_set3d, local_index_t axis_to_remove )
3838
{
3939
auto point_set2d = PointSet2D::create();
4040
auto builder2d = PointSetBuilder2D::create( *point_set2d );
@@ -48,7 +48,7 @@ namespace geode
4848

4949
std::unique_ptr< PointSet3D > convert_point_set2d_into_3d(
5050
const PointSet2D& point_set2d,
51-
index_t axis_to_add,
51+
local_index_t axis_to_add,
5252
double axis_coordinate )
5353
{
5454
auto point_set3d = PointSet3D::create();

src/geode/mesh/helpers/convert_surface_mesh.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ namespace geode
442442

443443
std::unique_ptr< SurfaceMesh3D > convert_surface_mesh2d_into_3d(
444444
const SurfaceMesh2D& surface2d,
445-
index_t axis_to_add,
445+
local_index_t axis_to_add,
446446
double axis_coordinate )
447447
{
448448
auto surface3d = SurfaceMesh3D::create();
@@ -456,7 +456,7 @@ namespace geode
456456
}
457457

458458
std::unique_ptr< SurfaceMesh2D > convert_surface_mesh3d_into_2d(
459-
const SurfaceMesh3D& surface3d, index_t axis_to_remove )
459+
const SurfaceMesh3D& surface3d, local_index_t axis_to_remove )
460460
{
461461
auto surface2d = SurfaceMesh2D::create();
462462
auto builder2d = SurfaceMeshBuilder2D::create( *surface2d );
@@ -470,7 +470,7 @@ namespace geode
470470

471471
std::unique_ptr< PolygonalSurface3D > convert_polygonal_surface2d_into_3d(
472472
const PolygonalSurface2D& surface2d,
473-
index_t axis_to_add,
473+
local_index_t axis_to_add,
474474
double axis_coordinate )
475475
{
476476
auto surface3d = PolygonalSurface3D::create();
@@ -484,7 +484,7 @@ namespace geode
484484
}
485485

486486
std::unique_ptr< PolygonalSurface2D > convert_polygonal_surface3d_into_2d(
487-
const PolygonalSurface3D& surface3d, index_t axis_to_remove )
487+
const PolygonalSurface3D& surface3d, local_index_t axis_to_remove )
488488
{
489489
auto surface2d = PolygonalSurface2D::create();
490490
auto builder2d = PolygonalSurfaceBuilder2D::create( *surface2d );
@@ -499,7 +499,7 @@ namespace geode
499499
std::unique_ptr< TriangulatedSurface3D >
500500
convert_triangulated_surface2d_into_3d(
501501
const TriangulatedSurface2D& surface2d,
502-
index_t axis_to_add,
502+
local_index_t axis_to_add,
503503
double axis_coordinate )
504504
{
505505
auto surface3d = TriangulatedSurface3D::create();
@@ -514,7 +514,8 @@ namespace geode
514514

515515
std::unique_ptr< TriangulatedSurface2D >
516516
convert_triangulated_surface3d_into_2d(
517-
const TriangulatedSurface3D& surface3d, index_t axis_to_remove )
517+
const TriangulatedSurface3D& surface3d,
518+
local_index_t axis_to_remove )
518519
{
519520
auto surface2d = TriangulatedSurface2D::create();
520521
auto builder2d = TriangulatedSurfaceBuilder2D::create( *surface2d );

src/geode/model/helpers/convert_brep_section.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ namespace
476476
namespace geode
477477
{
478478
std::tuple< Section, ModelCopyMapping > convert_brep_into_section(
479-
const BRep& brep, index_t axis_to_remove )
479+
const BRep& brep, local_index_t axis_to_remove )
480480
{
481481
Section section;
482482
SectionBuilder builder{ section };
@@ -510,7 +510,9 @@ namespace geode
510510
}
511511

512512
std::tuple< BRep, ModelCopyMapping > convert_section_into_brep(
513-
const Section& section, index_t axis_to_add, double axis_coordinate )
513+
const Section& section,
514+
local_index_t axis_to_add,
515+
double axis_coordinate )
514516
{
515517
BRep brep;
516518
BRepBuilder builder{ brep };

0 commit comments

Comments
 (0)