MCPcopy Create free account
hub / github.com/assimp/assimp / ProcessExtrudedAreaSolid

Function ProcessExtrudedAreaSolid

code/AssetLib/IFC/IFCGeometry.cpp:690–728  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

688
689// ------------------------------------------------------------------------------------------------
690void ProcessExtrudedAreaSolid(const Schema_2x3::IfcExtrudedAreaSolid& solid,
691 TempMesh& result,
692 ConversionData& conv,
693 bool collect_openings) {
694 TempMesh meshout;
695
696 // First read the profile description.
697 if(!ProcessProfile(*solid.SweptArea,meshout,conv) || meshout.mVerts.size()<=1) {
698 return;
699 }
700
701 IfcVector3 dir;
702 ConvertDirection(dir,solid.ExtrudedDirection);
703 dir *= solid.Depth;
704
705 // Some profiles bring their own holes, for which we need to provide a container. This all is somewhat backwards,
706 // and there's still so many corner cases uncovered - we really need a generic solution to all of this hole carving.
707 std::vector<TempOpening> fisherPriceMyFirstOpenings;
708 std::vector<TempOpening>* oldApplyOpenings = conv.apply_openings;
709 if( const Schema_2x3::IfcArbitraryProfileDefWithVoids* const cprofile = solid.SweptArea->ToPtr<Schema_2x3::IfcArbitraryProfileDefWithVoids>() ) {
710 if( !cprofile->InnerCurves.empty() ) {
711 // read all inner curves and extrude them to form proper openings.
712 std::vector<TempOpening>* oldCollectOpenings = conv.collect_openings;
713 conv.collect_openings = &fisherPriceMyFirstOpenings;
714
715 for (const Schema_2x3::IfcCurve* curve : cprofile->InnerCurves) {
716 TempMesh curveMesh, tempMesh;
717 ProcessCurve(*curve, curveMesh, conv);
718 ProcessExtrudedArea(solid, curveMesh, dir, tempMesh, conv, true);
719 }
720 // and then apply those to the geometry we're about to generate
721 conv.apply_openings = conv.collect_openings;
722 conv.collect_openings = oldCollectOpenings;
723 }
724 }
725
726 ProcessExtrudedArea(solid, meshout, dir, result, conv, collect_openings);
727 conv.apply_openings = oldApplyOpenings;
728}
729
730// ------------------------------------------------------------------------------------------------
731void ProcessSweptAreaSolid(const Schema_2x3::IfcSweptAreaSolid& swept,

Calls 6

ProcessProfileFunction · 0.85
ConvertDirectionFunction · 0.85
ProcessCurveFunction · 0.85
ProcessExtrudedAreaFunction · 0.85
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected