MCPcopy Create free account
hub / github.com/Geode-solutions/OpenGeode / add_surfaces

Function add_surfaces

tests/model/test-brep.cpp:119–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119std::array< geode::uuid, 5 > add_surfaces(
120 const geode::BRep& model, geode::BRepBuilder& builder )
121{
122 std::array< geode::uuid, 5 > uuids;
123 for( const auto s : geode::Range{ 2 } )
124 {
125 uuids[s] = builder.add_surface(
126 geode::OpenGeodeTriangulatedSurface3D::impl_name_static() );
127 builder.set_surface_name( uuids[s], absl::StrCat( "surface", s + 1 ) );
128 }
129 for( const auto s : geode::Range{ 2, 5 } )
130 {
131 uuids[s] = builder.add_surface(
132 geode::OpenGeodePolygonalSurface3D::impl_name_static() );
133 }
134 const auto& temp_surface = model.surface( builder.add_surface() );
135 builder.remove_surface( temp_surface );
136 const auto message = absl::StrCat( "BRep should have ", 5, " surfaces" );
137 geode::OpenGeodeModelException::test( model.nb_surfaces() == 5, message );
138 geode::OpenGeodeModelException::test(
139 geode::detail::count_range_elements( model.surfaces() ) == 5, message );
140 geode::OpenGeodeModelException::test(
141 model.surface( uuids[1] ).name() == "surface2", "Wrong Surface name" );
142 geode::OpenGeodeModelException::test(
143 model.nb_active_surfaces() == 5, message );
144 builder.set_surface_active( uuids[1], false );
145 builder.set_surface_active( uuids[4], false );
146 geode::OpenGeodeModelException::test(
147 model.nb_active_surfaces() == 3, "BRep should have 3 active surfaces" );
148 geode::OpenGeodeModelException::test(
149 model.nb_surfaces() == 5, "BRep should still have 5 surfaces" );
150 return uuids;
151}
152
153geode::uuid add_block( const geode::BRep& model, geode::BRepBuilder& builder )
154{

Callers 1

testFunction · 0.70

Calls 11

count_range_elementsFunction · 0.85
nb_surfacesMethod · 0.80
surfacesMethod · 0.80
nameMethod · 0.80
nb_active_surfacesMethod · 0.80
testFunction · 0.70
impl_name_staticFunction · 0.50
add_surfaceMethod · 0.45
set_surface_nameMethod · 0.45
remove_surfaceMethod · 0.45
set_surface_activeMethod · 0.45

Tested by

no test coverage detected