Compare e578ad3 ... +36 ... b0ca5e6

Coverage Reach
wing/CCPACSWingComponentSegment.cpp wing/CCPACSWingSegment.cpp wing/CCPACSWing.cpp wing/CCPACSWingRibsDefinition.cpp wing/CCPACSWingCell.cpp wing/CCPACSWingSparSegment.cpp wing/CTiglWingProfilePointList.cpp wing/tiglwingribhelperfunctions.cpp wing/CCPACSWingProfile.cpp wing/CCPACSWingProfileCST.cpp wing/CTiglWingStructureReference.cpp wing/CCPACSWingSparPosition.cpp wing/CCPACSWingRibsPositioning.cpp wing/CCPACSWingCellPositionSpanwise.cpp wing/tigletaxsifunctions.cpp wing/CTiglWingChordface.cpp wing/CCPACSWingRibExplicitPositioning.cpp wing/CTiglWingBuilder.cpp wing/CCPACSWingCSStructure.cpp wing/CTiglWingSegmentGuidecurveBuilder.cpp wing/CCPACSWingCellPositionChordwise.cpp wing/CTiglWingConnection.cpp wing/CCPACSWingSegments.cpp wing/CCPACSWings.cpp wing/CCPACSWingProfileGetPointAlgo.cpp wing/CCPACSWingShell.cpp wing/CCPACSWingProfiles.cpp wing/CCPACSWingComponentSegments.cpp wing/CCPACSWingRibsDefinitions.cpp wing/CCPACSWingSection.cpp wing/CCPACSWingSparSegments.cpp wing/CCPACSWingSectionElement.cpp wing/CCPACSWingCells.cpp wing/CCPACSWingSections.cpp wing/CCPACSWingRibRotation.cpp wing/CCPACSWingSectionElements.cpp wing/CTiglWingSegmentList.h wing/CCPACSWingRibCrossSection.cpp wing/CCPACSWingSparPositions.cpp wing/CCPACSWingSparPositionUIDs.cpp wing/CCPACSWingRibsDefinition.h wing/EtaXsi.h wing/CCPACSWingComponentSegment.h wing/CCPACSWingSegment.h wing/CCPACSWingSparSegment.h wing/CCPACSWing.h wing/CTiglWingChordface.h wing/CCPACSWingSpars.cpp wing/CCPACSWingSegments.h wing/CCPACSWingProfileCST.h wing/ITiglWingProfileAlgo.h wing/CTiglWingProfilePointList.h wing/CCPACSWingCell.h wing/CCPACSWingSparPositions.h wing/CCPACSWingRibsDefinitions.h wing/CCPACSWingComponentSegments.h wing/CCPACSWingCSStructure.h wing/CCPACSWingSparPosition.h wing/CCPACSWings.h wing/CCPACSWingSectionElement.h wing/CCPACSWingProfiles.h wing/CCPACSWingRibCrossSection.h wing/CCPACSWingCells.h wing/CTiglWingConnection.h wing/CCPACSWingSparSegments.h wing/CCPACSWingCellPositionSpanwise.h wing/CCPACSWingSpars.h wing/CCPACSWingSectionElements.h wing/CCPACSWingSection.h wing/CCPACSWingSparPositionUIDs.h wing/CCPACSWingProfileGetPointAlgo.h wing/CCPACSWingCellPositionChordwise.h wing/CCPACSWingRibRotation.h wing/CCPACSWingSections.h wing/CCPACSWingShell.h api/tigl.cpp geometry/CTiglBSplineAlgorithms.cpp geometry/CTiglTransformation.cpp geometry/CTiglBSplineApproxInterp.cpp geometry/CTiglPolyData.cpp geometry/CTiglIntersectionCalculation.cpp geometry/CTiglBSplineFit.cpp geometry/CTiglInterpolateCurveNetwork.cpp geometry/CTiglTriangularizer.cpp geometry/CFunctionToBspline.cpp geometry/CTiglMakeLoft.cpp geometry/CTiglPointsToBSplineInterpolation.cpp geometry/CCPACSTransformation.cpp geometry/CTiglInterpolatePointsWithKinks.cpp geometry/CTiglGordonSurfaceBuilder.cpp geometry/CTiglRelativelyPositionedComponent.cpp geometry/CTiglTopoAlgorithms.cpp geometry/CNamedShape.cpp geometry/CTiglPoint.cpp geometry/CTiglCurvesToSurface.cpp geometry/CTiglInterpolateBsplineWire.cpp geometry/CTiglPatchShell.cpp geometry/CTiglInterpolateLinearWire.cpp geometry/CTiglAbstractGeometricComponent.cpp geometry/CCPACSRotationCurve.cpp geometry/CCPACSGenericSystem.cpp geometry/CCPACSFarField.cpp geometry/CTiglProjectOnLinearSpline.cpp geometry/CTiglLineSegment.cpp geometry/CTiglArcLengthReparameterization.cpp geometry/CCSTCurveBuilder.cpp geometry/CPointsToLinearBSpline.cpp geometry/CTiglConcatSurfaces.cpp geometry/CTiglShapeCache.cpp geometry/CWireToCurve.cpp geometry/CCPACSGenericSystems.cpp geometry/CTiglCompoundSurface.cpp geometry/CTiglAbstractSegment.h geometry/CCPACSACSystems.cpp geometry/ECPACSTranslationType.h geometry/CTiglCurvesToSurface.h geometry/CCPACSRotationCurve.h geometry/CTiglBSplineApproxInterp.h geometry/CTiglTriangularizer.h geometry/ITiglGeometricComponent.h geometry/ITiglWireAlgorithm.h geometry/CTiglCompoundSurface.h geometry/CCPACSGenericSystem.h geometry/CTiglInterpolatePointsWithKinks.h geometry/CTiglPatchShell.h geometry/CTiglConcatSurfaces.h geometry/CTiglLineSegment.h geometry/CNamedShape.h geometry/CTiglPointsToBSplineInterpolation.h geometry/CTiglBSplineAlgorithms.h geometry/CTiglAbstractGeometricComponent.h geometry/CTiglPolyData.h geometry/CTiglArcLengthReparameterization.h geometry/CTiglBSplineFit.h geometry/CCPACSFarField.h geometry/CCSTCurveBuilder.h geometry/CTiglApproxResult.h geometry/CTiglIntersectionPoint.h geometry/CTiglRelativelyPositionedComponent.h geometry/CTiglInterpolateCurveNetwork.h geometry/CTiglMakeLoft.h geometry/CTiglInterpolateBsplineWire.h geometry/CWireToCurve.h geometry/CCPACSTransformation.h geometry/CTiglGordonSurfaceBuilder.h geometry/CTiglShapeCache.h fuselage/CCPACSFuselageSegment.cpp fuselage/CCPACSFuselage.cpp fuselage/CCPACSFrame.cpp fuselage/CCPACSFuselageProfile.cpp fuselage/CCPACSFuselageStringerFramePosition.cpp fuselage/CCPACSFuselageStringer.cpp fuselage/CTiglStringerFrameBorderedObject.cpp fuselage/CCPACSCrossBeamAssemblyPosition.cpp fuselage/CCPACSCrossBeamStrutAssemblyPosition.cpp fuselage/CCPACSPressureBulkheadAssemblyPosition.cpp fuselage/CTiglFuselageConnection.cpp fuselage/CCPACSLongFloorBeam.cpp fuselage/CCPACSFuselageSegments.cpp fuselage/CCPACSFuselageProfiles.cpp fuselage/CTiglFuselageSegmentGuidecurveBuilder.cpp fuselage/CCPACSLongFloorBeamPosition.cpp fuselage/CCPACSFuselageProfileGetPointAlgo.cpp fuselage/CCPACSDoorAssemblyPosition.cpp fuselage/CCPACSFuselages.cpp fuselage/CCPACSFuselageSectionElement.cpp fuselage/CCPACSFuselageSection.cpp fuselage/CCPACSSkinSegment.cpp fuselage/CCPACSFuselageStructure.cpp fuselage/CCPACSFuselageSections.cpp fuselage/CCPACSFuselageSectionElements.cpp fuselage/CCPACSCargoCrossBeamStrutsAssembly.cpp fuselage/CCPACSFramesAssembly.cpp fuselage/CCPACSLongFloorBeamsAssembly.cpp fuselage/CCPACSCargoCrossBeamsAssembly.cpp fuselage/CCPACSPressureBulkheadAssembly.cpp fuselage/CCPACSStringersAssembly.cpp fuselage/CCPACSFuselageSegment.h fuselage/CTiglStringerFrameBorderedObject.h fuselage/CCPACSFuselage.h fuselage/CCPACSFuselageProfile.h fuselage/CCPACSFuselageSections.h fuselage/CCPACSFuselages.h fuselage/CCPACSCrossBeamAssemblyPosition.h fuselage/CCPACSFuselageStructure.h fuselage/CCPACSFuselageProfiles.h fuselage/CTiglFuselageConnection.h fuselage/CCPACSStringersAssembly.h fuselage/CCPACSPressureBulkheadAssemblyPosition.h fuselage/CCPACSDoorAssemblyPosition.h fuselage/CCPACSFuselageSectionElements.h fuselage/CCPACSLongFloorBeam.h fuselage/CCPACSFuselageSectionElement.h fuselage/CCPACSFuselageSection.h fuselage/CCPACSCargoCrossBeamsAssembly.h fuselage/CCPACSCargoCrossBeamStrutsAssembly.h fuselage/CCPACSFramesAssembly.h fuselage/CCPACSPressureBulkheadAssembly.h fuselage/CCPACSFrame.h fuselage/CCPACSCrossBeamStrutAssemblyPosition.h fuselage/CCPACSFuselageStringerFramePosition.h fuselage/CCPACSFuselageSegments.h fuselage/CCPACSLongFloorBeamPosition.h fuselage/CCPACSFuselageProfileGetPointAlgo.h fuselage/CCPACSSkinSegment.h fuselage/CCPACSLongFloorBeamsAssembly.h fuselage/CCPACSFuselageStringer.h common/tiglcommonfunctions.cpp common/COptionList.h common/any.h common/Debugging.cpp common/tiglcommonfunctions.h common/stringtools.h common/sorting.h common/ReentryGuard.h common/to_string.h common/typename.cpp common/Debugging.h common/typename.h exports/CTiglExportVtk.cpp exports/CTiglExportIges.cpp exports/CTiglExportCollada.cpp exports/CTiglExportStep.cpp exports/CTiglCADExporter.cpp exports/CTiglExportStl.cpp exports/CTiglCADExporter.h exports/CTiglExporterFactory.cpp exports/CTiglExportBrep.cpp exports/CTiglExportIges.h exports/CGlobalExporterConfigs.cpp exports/CTiglExportStep.h exports/CTiglExportBrep.h exports/CCPACSImportExport.h exports/CTiglExportVtk.h exports/CTiglExportCollada.h exports/CTiglExportStl.h exports/CTiglExporterFactory.h exports/CGlobalExporterConfigs.h contrib/SurfTools.cxx contrib/MakePatches.cxx contrib/MakeLoops.cxx contrib/MakeLoops.hxx contrib/MakePatches.hxx math/tiglmathfunctions.cpp math/CTiglIntersectBSplines.cpp math/CTiglPointTranslator.cpp math/CTiglProjectPointOnCurveAtAngle.cpp math/CTiglOptimizer.cpp math/ITiglObjectiveFunction.cpp math/CTiglProjectPointOnCurveAtAngle.h math/CTiglPointTranslator.h math/tiglmathfunctions.h math/CTiglIntersectBSplines.h boolean_operations/GEOMAlgo_Splitter.cxx boolean_operations/CTrimShape.cpp boolean_operations/CFuseShapes.cpp boolean_operations/CMergeShapes.cpp boolean_operations/CBopCommon.cpp boolean_operations/CCutShape.cpp boolean_operations/CBooleanOperTools.cpp boolean_operations/CGroupShapes.cpp boolean_operations/BRepSewingToBRepBuilderShapeAdapter.cpp boolean_operations/BOPBuilderShapeToBRepBuilderShapeAdapter.cpp boolean_operations/BOPBuilderShapeToBRepBuilderShapeAdapter.h boolean_operations/BRepSewingToBRepBuilderShapeAdapter.h engine_nacelle/CCPACSNacelleCowl.cpp engine_nacelle/CTiglNacelleGuideCurveBuilder.cpp engine_nacelle/CCPACSNacelleProfile.cpp engine_nacelle/CCPACSNacelleSection.cpp engine_nacelle/CCPACSNacelleCenterCowl.cpp engine_nacelle/CCPACSEnginePosition.cpp engine_nacelle/CTiglEngineNacelleBuilder.cpp engine_nacelle/CCPACSNacelleSections.cpp engine_nacelle/CCPACSEnginePositions.cpp engine_nacelle/CCPACSEngines.cpp engine_nacelle/CCPACSNacelleGuideCurves.cpp engine_nacelle/CCPACSEnginePosition.h engine_nacelle/CCPACSNacelleCowl.h engine_nacelle/CTiglNacelleGuideCurveBuilder.h engine_nacelle/CCPACSNacelleProfile.h engine_nacelle/CCPACSEnginePositions.h engine_nacelle/CCPACSNacelleSection.h engine_nacelle/CCPACSEngines.h engine_nacelle/CCPACSNacelleSections.h engine_nacelle/CCPACSNacelleCenterCowl.h engine_nacelle/CCPACSNacelleGuideCurves.h control_devices/CCPACSTrailingEdgeDevice.cpp control_devices/CControlSurfaceBorderBuilder.cpp control_devices/CCPACSControlSurfaceBorderTrailingEdge.cpp control_devices/CTiglControlSurfaceTransformation.cpp control_devices/CCPACSControlSurfaceWingCutOut.cpp control_devices/CCPACSControlSurfaceOuterShapeTrailingEdge.cpp control_devices/CTiglControlSurfaceBorderCoordinateSystem.cpp control_devices/CCPACSControlSurfaces.cpp control_devices/CCPACSTrailingEdgeDevice.h control_devices/CCPACSControlSurfaceOuterShapeTrailingEdge.h control_devices/CCPACSControlSurfaceWingCutOut.h control_devices/CCPACSControlSurfaces.h control_devices/CCPACSControlSurfaceBorderTrailingEdge.h configuration/CCPACSConfiguration.cpp configuration/CTiglFusePlane.cpp configuration/CCPACSConfigurationManager.cpp configuration/CTiglShapeGeomComponentAdaptor.h configuration/CTiglFusePlane.h rotor/CTiglAttachedRotorBlade.cpp rotor/CCPACSRotor.cpp rotor/CCPACSRotorBladeAttachment.cpp rotor/CCPACSRotorProfiles.cpp rotor/CCPACSRotorHub.cpp rotor/CCPACSRotorBlades.cpp rotor/CCPACSRotorHinge.cpp rotor/CCPACSRotors.cpp rotor/CCPACSRotorBladeAttachments.cpp rotor/CCPACSRotorHinges.cpp rotor/CCPACSRotor.h rotor/CTiglAttachedRotorBlade.h rotor/CCPACSRotorProfiles.h rotor/CCPACSRotorHinge.h rotor/CCPACSRotorBladeAttachments.h rotor/CCPACSRotors.h rotor/CCPACSRotorBlades.h rotor/CCPACSRotorBladeAttachment.h rotor/CCPACSRotorHinges.h rotor/CCPACSRotorHub.h guide_curves/CTiglCurveConnector.cpp guide_curves/CTiglCurveNetworkSorter.cpp guide_curves/CCPACSGuideCurves.cpp guide_curves/CCPACSGuideCurve.cpp guide_curves/CCPACSGuideCurveAlgo.h guide_curves/CCPACSGuideCurveProfiles.cpp guide_curves/CTiglCurveNetworkSorter.h guide_curves/CTiglCurveConnector.h guide_curves/CCPACSGuideCurveProfile.cpp guide_curves/CCPACSGuideCurveProfile.h guide_curves/CCPACSGuideCurveProfiles.h guide_curves/CCPACSGuideCurves.h guide_curves/CCPACSGuideCurve.h cpacs_other/CTiglUIDManager.cpp cpacs_other/CCPACSExternalObject.cpp cpacs_other/CCPACSMaterialDefinition.cpp cpacs_other/CTiglUIDManager.h cpacs_other/CCPACSAircraftModel.cpp cpacs_other/CCPACSRotorcraftModel.cpp cpacs_other/CTiglUIDObject.cpp cpacs_other/CCPACSExternalObjects.cpp cpacs_other/CTiglUIDObject.h cpacs_other/CCPACSProfiles.cpp cpacs_other/CCPACSStructuralProfiles.cpp cpacs_other/CCPACSStructuralProfiles.h cpacs_other/CCPACSExternalObject.h cpacs_other/CCPACSMaterialDefinition.h cpacs_other/CCPACSRotorcraftModel.h cpacs_other/CCPACSProfiles.h cpacs_other/CCPACSAircraftModel.h cpacs_other/CCPACSExternalObjects.h cpacs_other/ITiglUIDRefObject.h structural_elements/CCPACSFuselageWallSegment.cpp structural_elements/CCPACSWallPosition.cpp structural_elements/CCPACSWalls.cpp structural_elements/CCPACSProfileBasedStructuralElement.cpp structural_elements/CCPACSSheetList.cpp structural_elements/CCPACSFuselageWallSegment.h structural_elements/CCPACSPressureBulkhead.cpp structural_elements/CCPACSDoors.cpp structural_elements/CCPACSPressureBulkheads.cpp structural_elements/CCPACSSheetList.h structural_elements/CCPACSProfileBasedStructuralElement.h structural_elements/CCPACSDoors.h structural_elements/CCPACSPressureBulkheads.h structural_elements/CCPACSWalls.h structural_elements/CCPACSPressureBulkhead.h structural_elements/CCPACSWallPosition.h logging/CTiglLogging.cpp logging/CTiglFileLogger.cpp logging/CTiglLogSplitter.cpp logging/CTiglConsoleLogger.cpp logging/ITiglLogger.h logging/CTiglConsoleLogger.h imports/CTiglStepReader.cpp imports/CTiglImporterFactory.cpp imports/ICADImporterCreator.h imports/ITiglCADImporter.h imports/CTiglImporterFactory.h CCPACSPositioning.cpp engine_pylon/CCPACSEnginePylons.cpp engine_pylon/CCPACSEnginePylon.cpp engine_pylon/CTiglEnginePylonBuilder.cpp engine_pylon/CTiglEnginePylonBuilder.h engine_pylon/CCPACSEnginePylon.h engine_pylon/CCPACSEnginePylons.h CCPACSCurvePointListXYZ.cpp CCPACSPositionings.cpp CCPACSPointAbsRel.cpp CCPACSPoint.cpp CCPACSStringVector.cpp TiglRotorHubType.h TiglFarFieldType.h CCPACSCurveParamPointMap.cpp TiglSymmetryAxis.h system/CTiglMemoryPool.cpp system/CTiglTypeRegistry.cpp system/CTiglError.cpp CCPACSPointListRelXYZVector.cpp CCPACSEtaIsoLine.cpp CCPACSPointXY.cpp CCPACSPointListXYVector.cpp CCPACSEtaXsiPoint.cpp CCPACSPointListXY.cpp Cache.h CCPACSCurvePoint.cpp CCPACSXsiIsoLine.cpp CCPACSCurvePointListXYZ.h CCPACSEtaXsiPoint.h CCPACSCurvePoint.h CCPACSPointXY.h CCPACSPoint.h CCPACSPointListRelXYZVector.h CCPACSPositioning.h CCPACSStringVector.h CCPACSEtaIsoLine.h CCPACSPointListXY.h CCPACSXsiIsoLine.h CCPACSPointAbsRel.h CCPACSPointListXYVector.h CCPACSCurveParamPointMap.h

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -0,0 +1,85 @@
Loading
1 +
/*
2 +
* Copyright (C) 2020 German Aerospace Center (DLR/SC)
3 +
*
4 +
* Created: 2020-09-10 Martin Siggel <Martin.Siggel@dlr.de>
5 +
*
6 +
* Licensed under the Apache License, Version 2.0 (the "License");
7 +
* you may not use this file except in compliance with the License.
8 +
* You may obtain a copy of the License at
9 +
*
10 +
*     http://www.apache.org/licenses/LICENSE-2.0
11 +
*
12 +
* Unless required by applicable law or agreed to in writing, software
13 +
* distributed under the License is distributed on an "AS IS" BASIS,
14 +
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 +
* See the License for the specific language governing permissions and
16 +
* limitations under the License.
17 +
*/
18 +
19 +
#include "CTiglConcatSurfaces.h"
20 +
21 +
#include <CTiglBSplineAlgorithms.h>
22 +
#include <CTiglError.h>
23 +
24 +
#include <algorithm>
25 +
26 +
namespace tigl
27 +
{
28 +
29 +
CTiglConcatSurfaces::CTiglConcatSurfaces(const std::vector<Handle(Geom_BSplineSurface)>& surfaces,
30 +
                                         const std::vector<double>& surfaceParams, ConcatDir dir)
31 +
    : m_surfaces(surfaces)
32 +
    , m_params(surfaceParams)
33 +
    , m_dir(dir)
34 +
{
35 +
36 +
    if (surfaces.size() + 1 != surfaceParams.size()) {
37 +
        throw CTiglError("Surfaces dont match parameters: Number of parameters != number of surfaces + 1");
38 +
    }
39 +
40 +
    if (dir ==ConcatDir::v) {
41 +
        throw CTiglError("CTiglConcatSurfaces in v-direction not yet implemented");
42 +
    }
43 +
44 +
    std::sort(m_params.begin(), m_params.end());
45 +
}
46 +
47 +
void CTiglConcatSurfaces::SetMakeKnotsUniformEnabled(unsigned int nUSeg, unsigned int nVSeg)
48 +
{
49 +
    if (nUSeg > 0 && nVSeg > 0) {
50 +
        m_approxSegments.reset({nUSeg, nVSeg});
51 +
    }
52 +
    else {
53 +
        m_approxSegments.reset();
54 +
    }
55 +
}
56 +
57 +
Handle(Geom_BSplineSurface) CTiglConcatSurfaces::Surface() const
58 +
{
59 +
    // create a copy of all surfaces
60 +
    std::vector<Handle(Geom_BSplineSurface)> surfaces;
61 +
    std::transform(std::begin(m_surfaces), std::end(m_surfaces), std::back_inserter(surfaces),
62 +
                   [](const Handle(Geom_BSplineSurface) & surf) {
63 +
                       return Handle(Geom_BSplineSurface)::DownCast(surf->Copy());
64 +
                   });
65 +
66 +
    if (m_approxSegments) {
67 +
        std::transform(
68 +
            std::begin(surfaces), std::end(surfaces), std::begin(surfaces), [this](Handle(Geom_BSplineSurface) & surf) {
69 +
                return CTiglBSplineAlgorithms::makeKnotsUniform(surf, m_approxSegments->nu, m_approxSegments->nv);
70 +
            });
71 +
    }
72 +
73 +
    for (size_t surfIdx = 0; surfIdx < surfaces.size(); ++surfIdx) {
74 +
        CTiglBSplineAlgorithms::reparametrizeBSpline(*surfaces[surfIdx], m_params[surfIdx], m_params[surfIdx + 1], 0.,
75 +
                                                     1., 1e-10);
76 +
    }
77 +
78 +
    for (size_t surfIdx = 1; surfIdx < surfaces.size(); ++surfIdx) {
79 +
        surfaces[0] = CTiglBSplineAlgorithms::concatSurfacesUDir(surfaces[0], surfaces[surfIdx]);
80 +
    }
81 +
82 +
    return surfaces[0];
83 +
}
84 +
85 +
} // namespace tigl

@@ -45,6 +45,9 @@
Loading
45 45
#include "tigl_config.h"
46 46
#include "math/tiglmathfunctions.h"
47 47
#include "CNamedShape.h"
48 +
#include "CTiglWingBuilder.h"
49 +
#include "CTiglConcatSurfaces.h"
50 +
#include "GeomConvert.hxx"
48 51
49 52
#include "BRepOffsetAPI_ThruSections.hxx"
50 53
#include "TopExp_Explorer.hxx"
@@ -126,42 +129,6 @@
Loading
126 129
        return trafo.Transform(point);
127 130
    }
128 131
129 -
    // Set the face traits
130 -
    void SetFaceTraits (PNamedShape loft, std::string shapeUID) 
131 -
    { 
132 -
        // designated names of the faces
133 -
        std::vector<std::string> names(5);
134 -
        names[0]="Bottom";
135 -
        names[1]="Top";
136 -
        names[2]="TrailingEdge";
137 -
        names[3]="Inside";
138 -
        names[4]="Outside";
139 -
140 -
        // map of faces
141 -
        TopTools_IndexedMapOfShape map;
142 -
        TopExp::MapShapes(loft->Shape(), TopAbs_FACE, map);
143 -
        
144 -
        for (int iFace = 0; iFace < map.Extent(); ++iFace) {
145 -
            loft->FaceTraits(iFace).SetComponentUID(shapeUID);
146 -
        }
147 -
148 -
        // check if number of faces is correct (only valid for ruled surfaces lofts)
149 -
        if (map.Extent() != 5 && map.Extent() != 4) {
150 -
            LOG(ERROR) << "CCPACSWingSegment: Unable to determine face names in ruled surface loft";
151 -
            return;
152 -
        }
153 -
        // remove trailing edge name if there is no trailing edge
154 -
        if (map.Extent() == 4) {
155 -
            names.erase(names.begin()+2);
156 -
        }
157 -
        // set face trait names
158 -
        for (int i = 0; i < map.Extent(); i++) {
159 -
            CFaceTraits traits = loft->GetFaceTraits(i);
160 -
            traits.SetName(names[i].c_str());
161 -
            loft->SetFaceTraits(i, traits);
162 -
        }
163 -
    }
164 -
    
165 132
    /**
166 133
     * @brief getFaceTrimmingEdge Creates an edge in parameter space to trim a face
167 134
     * @return 
@@ -486,7 +453,11 @@
Loading
486 453
    std::string loftName = GetUID();
487 454
    std::string loftShortName = GetShortShapeName();
488 455
    PNamedShape loft (new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str()));
489 -
    SetFaceTraits(loft, GetUID());
456 +
    std::vector<double> guideCurveParams = {};
457 +
    if (GetGuideCurves()) {
458 +
        guideCurveParams = GetGuideCurves()->GetRelativeCircumferenceParameters();
459 +
    }
460 +
    CTiglWingBuilder::SetFaceTraits(guideCurveParams,  GetUID(), loft, innerConnection.GetProfile().HasBluntTE());
490 461
    return loft;
491 462
}
492 463
@@ -974,11 +945,61 @@
Loading
974 945
975 946
void CCPACSWingSegment::MakeSurfaces(SurfaceCache& cache) const
976 947
{
977 -
    // make upper and lower surface
978 -
    cache.lowerSurface = BRep_Tool::Surface(TopoDS::Face(GetLowerShape()));
979 -
    cache.upperSurface = BRep_Tool::Surface(TopoDS::Face(GetUpperShape()));
980 -
    cache.lowerSurfaceLocal = BRep_Tool::Surface(TopoDS::Face(GetLowerShape(WING_COORDINATE_SYSTEM)));
981 -
    cache.upperSurfaceLocal = BRep_Tool::Surface(TopoDS::Face(GetUpperShape(WING_COORDINATE_SYSTEM)));
948 +
    auto globalToLocalTrsf = GetParent()->GetParent<CCPACSWing>()->GetTransformationMatrix()
949 +
                                 .Inverted();
950 +
951 +
    auto lowerShape = GetLowerShape(GLOBAL_COORDINATE_SYSTEM);
952 +
    auto upperShape = GetUpperShape(GLOBAL_COORDINATE_SYSTEM);
953 +
954 +
    if (m_guideCurves) {
955 +
        auto params = m_guideCurves->GetRelativeCircumferenceParameters();
956 +
        auto it = std::find_if(std::begin(params), std::end(params), [](double val) {
957 +
            // the leading edge is defined at parameter 0, we allow some tolerance
958 +
            return std::abs(val) < 1e-3;
959 +
        });
960 +
961 +
        if (it == params.end()) {
962 +
            // could not find leading edge guide curve
963 +
            throw CTiglError ("There is no guide curve defined at the leading edge");
964 +
        }
965 +
966 +
        // split into upper and lower parameters
967 +
        std::vector<double> lower_params, upper_params;
968 +
        std::copy(std::begin(params), it+1, std::back_inserter(lower_params));
969 +
        std::copy(it, std::end(params), std::back_inserter(upper_params));
970 +
971 +
        auto concatSurfs = [](const TopoDS_Shape& shape, const std::vector<double>& parms) {
972 +
            if (GetNumberOfFaces(shape) == 1) {
973 +
                return BRep_Tool::Surface(TopoDS::Face(shape));
974 +
            }
975 +
            else {
976 +
                std::vector<Handle(Geom_BSplineSurface)> surfs;
977 +
978 +
                for (TopExp_Explorer expl(shape, TopAbs_FACE); expl.More(); expl.Next()) {
979 +
                    const TopoDS_Face& face = TopoDS::Face(expl.Current());
980 +
                    auto bspl = GeomConvert::SurfaceToBSplineSurface(BRep_Tool::Surface(face));
981 +
                    surfs.push_back(bspl);
982 +
                }
983 +
984 +
                CTiglConcatSurfaces concat(surfs, parms, ConcatDir::u);
985 +
                return Handle(Geom_Surface)(concat.Surface());
986 +
            }
987 +
        };
988 +
989 +
        // make upper and lower surface
990 +
        cache.lowerSurface = concatSurfs(lowerShape, lower_params);
991 +
        cache.upperSurface = concatSurfs(upperShape, upper_params);
992 +
993 +
    }
994 +
    else {
995 +
        // make upper and lower surface
996 +
        cache.lowerSurface = BRep_Tool::Surface(TopoDS::Face(lowerShape));
997 +
        cache.upperSurface = BRep_Tool::Surface(TopoDS::Face(upperShape));
998 +
    }
999 +
1000 +
    cache.lowerSurfaceLocal = globalToLocalTrsf.Transform(cache.lowerSurface);
1001 +
    cache.upperSurfaceLocal = globalToLocalTrsf.Transform(cache.upperSurface);
1002 +
982 1003
}
983 1004
984 1005
void CCPACSWingSegment::MakeChordSurfaces(ChordSurfaceCache& cache) const

@@ -24,7 +24,10 @@
Loading
24 24
#include "tigl.h"
25 25
#include "BRepBuilderAPI_GTransform.hxx"
26 26
#include "BRepBuilderAPI_Transform.hxx"
27 +
#include "BRepBuilderAPI_MakeFace.hxx"
28 +
#include "BRep_Tool.hxx"
27 29
#include "gp_XYZ.hxx"
30 +
#include "TopoDS_Face.hxx"
28 31
#include "Standard_Version.hxx"
29 32
#include "CNamedShape.h"
30 33
@@ -428,6 +431,21 @@
Loading
428 431
    }
429 432
}
430 433
434 +
// Transforms a surface with the current transformation matrix and
435 +
// returns the transformed point
436 +
TIGL_EXPORT Handle(Geom_Surface) CTiglTransformation::Transform(const Handle(Geom_Surface)& surf) const
437 +
{
438 +
    auto surfCopy = Handle(Geom_Surface)::DownCast(surf->Copy());
439 +
440 +
    TopoDS_Face tmpFace = BRepBuilderAPI_MakeFace(surfCopy, 1e-6);
441 +
    tmpFace = TopoDS::Face(Transform(tmpFace));
442 +
    TopLoc_Location L;
443 +
    surfCopy = BRep_Tool::Surface(tmpFace, L);
444 +
    surfCopy->Transform(L.Transformation());
445 +
446 +
    return surfCopy;
447 +
}
448 +
431 449
PNamedShape tigl::CTiglTransformation::Transform(PNamedShape shape) const
432 450
{
433 451
    if (!shape) {

@@ -25,6 +25,7 @@
Loading
25 25
#include "CTiglPointsToBSplineInterpolation.h"
26 26
#include "to_string.h"
27 27
#include "tiglcommonfunctions.h"
28 +
#include "Debugging.h"
28 29
29 30
#include <Standard_Version.hxx>
30 31
#include <Geom2d_BSplineCurve.hxx>
@@ -534,24 +535,24 @@
Loading
534 535
    return std::vector<Handle(Geom_BSplineCurve)>(splines_adapter.begin(), splines_adapter.end());
535 536
}
536 537
537 -
std::vector<Handle(Geom_BSplineSurface) > CTiglBSplineAlgorithms::createCommonKnotsVectorSurface(const std::vector<Handle(Geom_BSplineSurface) >& old_surfaces_vector)
538 +
std::vector<Handle(Geom_BSplineSurface) > CTiglBSplineAlgorithms::createCommonKnotsVectorSurface(const std::vector<Handle(Geom_BSplineSurface) >& old_surfaces_vector, SurfaceDirection dir)
538 539
{
539 -
    // all B-spline surfaces must have the same parameter range in u- and v-direction
540 -
    // TODO: Match parameter range
541 -
542 540
    // Create a copy that we can modify
543 541
    std::vector<SurfAdapterView> adapterSplines;
544 542
    for (size_t i = 0; i < old_surfaces_vector.size(); ++i) {
545 543
        adapterSplines.push_back(SurfAdapterView(Handle(Geom_BSplineSurface)::DownCast(old_surfaces_vector[i]->Copy()), udir));
546 544
    }
547 545
548 -
    // first in u direction
549 -
    makeGeometryCompatibleImpl(adapterSplines, 1e-15);
550 -
551 -
    for (size_t i = 0; i < old_surfaces_vector.size(); ++i) adapterSplines[i].setDir(vdir);
546 +
    if (dir == SurfaceDirection::u || dir == SurfaceDirection::both) {
547 +
        // first in u direction
548 +
        makeGeometryCompatibleImpl(adapterSplines, 1e-14);
549 +
    }
552 550
553 -
    // now in v direction
554 -
    makeGeometryCompatibleImpl(adapterSplines, 1e-15);
551 +
    if (dir == SurfaceDirection::v || dir == SurfaceDirection::both) {
552 +
         // now in v direction
553 +
        for (size_t i = 0; i < old_surfaces_vector.size(); ++i) adapterSplines[i].setDir(vdir);
554 +
        makeGeometryCompatibleImpl(adapterSplines, 1e-14);
555 +
    }
555 556
556 557
    return std::vector<Handle(Geom_BSplineSurface)>(adapterSplines.begin(), adapterSplines.end());
557 558
}
@@ -818,6 +819,23 @@
Loading
818 819
    }
819 820
}
820 821
822 +
void CTiglBSplineAlgorithms::reparametrizeBSpline(Geom_BSplineSurface& spline, double umin, double umax, double vmin, double vmax, double tol)
823 +
{
824 +
    if (std::abs(spline.UKnot(1) - umin) > tol || std::abs(spline.UKnot(spline.NbUKnots()) - umax) > tol) {
825 +
        TColStd_Array1OfReal aKnots (1, spline.NbUKnots());
826 +
        spline.UKnots (aKnots);
827 +
        BSplCLib::Reparametrize (umin, umax, aKnots);
828 +
        spline.SetUKnots (aKnots);
829 +
    }
830 +
831 +
    if (std::abs(spline.VKnot(1) - vmin) > tol || std::abs(spline.VKnot(spline.NbVKnots()) - vmax) > tol) {
832 +
        TColStd_Array1OfReal aKnots (1, spline.NbVKnots());
833 +
        spline.VKnots (aKnots);
834 +
        BSplCLib::Reparametrize (vmin, vmax, aKnots);
835 +
        spline.SetVKnots (aKnots);
836 +
    }
837 +
}
838 +
821 839
CTiglApproxResult CTiglBSplineAlgorithms::reparametrizeBSplineNiceKnots(Handle(Geom_BSplineCurve) spline)
822 840
{
823 841
    if (spline.IsNull()) {
@@ -1139,4 +1157,140 @@
Loading
1139 1157
    return result;
1140 1158
}
1141 1159
1160 +
Handle(Geom_BSplineSurface) CTiglBSplineAlgorithms::concatSurfacesUDir(Handle(Geom_BSplineSurface) bspl1,
1161 +
                                                                       Handle(Geom_BSplineSurface) bspl2,
1162 +
                                                                       double space_tol)
1163 +
{
1164 +
1165 +
    DEBUG_SCOPE(debug);
1166 +
    debug.addShape(BRepBuilderAPI_MakeFace(bspl1, 1e-6).Face(), "surf1");
1167 +
    debug.addShape(BRepBuilderAPI_MakeFace(bspl2, 1e-6).Face(), "surf2");
1168 +
1169 +
    // the surfaces must not be periodic in u direction
1170 +
    assert (bspl1->IsUPeriodic() == false);
1171 +
    assert (bspl2->IsUPeriodic() == false);
1172 +
1173 +
    // we dont have nurbs implemented right now
1174 +
    assert (bspl1->IsURational() == false);
1175 +
    assert (bspl2->IsURational() == false);
1176 +
    assert (bspl1->IsVRational() == false);
1177 +
    assert (bspl2->IsVRational() == false);
1178 +
1179 +
    double param_tol = 1e-14;
1180 +
1181 +
    // check that surfaces are following parametrically
1182 +
    double umin1, umax1, vmin1, vmax1;
1183 +
    bspl1->Bounds(umin1, umax1, vmin1, vmax1);
1184 +
    double umin2, umax2, vmin2, vmax2;
1185 +
    bspl2->Bounds(umin2, umax2, vmin2, vmax2);
1186 +
1187 +
    if (std::abs(umax1 - umin2) > param_tol) {
1188 +
        std::stringstream str;
1189 +
        str << "Surfaces do not follow in u-parametric direction in CTiglBSplineAlgorithms::concatSurfacesUDir. ";
1190 +
        str << "Surface 1 ends at " << umax1 << ", Surface 2 begins at " << umin2 << "!";
1191 +
        throw CTiglError(str.str(), TIGL_MATH_ERROR);
1192 +
    }
1193 +
1194 +
    bspl1->SetVNotPeriodic();
1195 +
    bspl2->SetVNotPeriodic();
1196 +
1197 +
    auto u_degree = std::max(bspl1->UDegree(), bspl2->UDegree());
1198 +
    auto v_degree = std::max(bspl1->VDegree(), bspl2->VDegree());
1199 +
1200 +
    bspl1->IncreaseDegree(u_degree, v_degree);
1201 +
    bspl2->IncreaseDegree(u_degree, v_degree);
1202 +
1203 +
    // check that corner points match
1204 +
    auto leftCornerDist = bspl1->Value(umax1, vmin1).Distance(bspl2->Value(umin2, vmin2));
1205 +
    auto rightCornerDist = bspl1->Value(umax1, vmax1).Distance(bspl2->Value(umin2, vmax2)) ;
1206 +
    if (leftCornerDist > space_tol || rightCornerDist > space_tol) {
1207 +
        throw CTiglError("Surfaces don't match within tolerances in CTiglBSplineAlgorithms::concatSurfacesUDir.", TIGL_MATH_ERROR);
1208 +
    }
1209 +
1210 +
    auto spl_vec = CTiglBSplineAlgorithms::createCommonKnotsVectorSurface({bspl1, bspl2}, SurfaceDirection::v);
1211 +
    bspl1 = spl_vec[0];
1212 +
    bspl2 = spl_vec[1];
1213 +
1214 +
    assert(bspl1->NbVPoles() == bspl2->NbVPoles());
1215 +
1216 +
    // concat control points
1217 +
    TColgp_Array2OfPnt cpsNew(1, bspl1->NbUPoles() + bspl2->NbUPoles() - 1, 1, bspl1->NbVPoles());
1218 +
    for (int iv = 0; iv < bspl1->NbVPoles(); ++iv) {
1219 +
        for (int iu = 0; iu < bspl1->NbUPoles() - 1; ++iu) {
1220 +
            cpsNew.SetValue(iu+1, iv+1, bspl1->Pole(iu+1, iv+1));
1221 +
        }
1222 +
        auto offset = bspl1->NbUPoles();
1223 +
        for (int iu = 0; iu < bspl2->NbUPoles(); ++iu) {
1224 +
            cpsNew.SetValue(iu + offset, iv+1, bspl2->Pole(iu+1, iv+1));
1225 +
        }
1226 +
    }
1227 +
1228 +
    // concat knots and mults
1229 +
    TColStd_Array1OfReal uknots_new(1, bspl1->NbUKnots() + bspl2->NbUKnots() - 1);
1230 +
    TColStd_Array1OfInteger umults_new(1, bspl1->NbUKnots() + bspl2->NbUKnots() - 1);
1231 +
1232 +
    for (int i = 0; i < bspl1->NbUKnots()-1; ++i) {
1233 +
        uknots_new.SetValue(i+1, bspl1->UKnot(i+1));
1234 +
        umults_new.SetValue(i+1, bspl1->UMultiplicity(i+1));
1235 +
    }
1236 +
1237 +
    int middleIdx = bspl1->NbUKnots();
1238 +
    uknots_new.SetValue(middleIdx, 0.5 * (bspl1->UKnot(middleIdx) + bspl2->UKnot(1)));
1239 +
    umults_new.SetValue(middleIdx, bspl1->UMultiplicity(middleIdx) - 1);
1240 +
1241 +
    for (int i = 1; i < bspl2->NbUKnots(); ++i) {
1242 +
        uknots_new.SetValue(i + middleIdx, bspl2->UKnot(i+1));
1243 +
        umults_new.SetValue(i + middleIdx, bspl2->UMultiplicity(i+1));
1244 +
    }
1245 +
1246 +
    // we simply take the v-knots of the first spline
1247 +
    TColStd_Array1OfReal vknots_new(1, bspl1->NbVKnots());
1248 +
    TColStd_Array1OfInteger vmults_new(1, bspl1->NbVKnots());
1249 +
    bspl1->VKnots(vknots_new);
1250 +
    bspl1->VMultiplicities(vmults_new);
1251 +
1252 +
#ifdef DEBUG
1253 +
    int sum_umults = 0;
1254 +
    for (int i = umults_new.Lower(); i <= umults_new.Upper(); ++i) {
1255 +
        sum_umults += umults_new.Value(i);
1256 +
    }
1257 +
1258 +
    int sum_vmults = 0;
1259 +
    for (int i = vmults_new.Lower(); i <= vmults_new.Upper(); ++i) {
1260 +
        sum_vmults += vmults_new.Value(i);
1261 +
    }
1262 +
1263 +
    assert(cpsNew.ColLength() + u_degree + 1 == sum_umults);
1264 +
    assert(cpsNew.RowLength() + v_degree + 1 == sum_vmults);
1265 +
#endif
1266 +
1267 +
    return new Geom_BSplineSurface(cpsNew, uknots_new, vknots_new,
1268 +
                                   umults_new, vmults_new,
1269 +
                                   u_degree, v_degree, false, false);
1270 +
}
1271 +
1272 +
Handle(Geom_BSplineSurface) CTiglBSplineAlgorithms::makeKnotsUniform(Handle(Geom_BSplineSurface) surf, unsigned int nseg_u, unsigned int nseg_v)
1273 +
{
1274 +
    double u1, u2, v1, v2;
1275 +
    surf->Bounds(u1, u2, v1, v2);
1276 +
1277 +
    // we create a degree 3 approximation in all directions
1278 +
    auto ncp_u = std::max(4, static_cast<int>(nseg_u + 1));
1279 +
    auto ncp_v = std::max(4, static_cast<int>(nseg_v + 1));
1280 +
1281 +
    auto u = LinspaceWithBreaks(u1, u2, ncp_u, {});
1282 +
    auto v = LinspaceWithBreaks(v1, v2, ncp_v, {});
1283 +
1284 +
    TColgp_Array2OfPnt points(1, ncp_u, 1, ncp_v);
1285 +
1286 +
    for (size_t i = 0; i < u.size(); ++i) {
1287 +
        for (size_t j = 0; j < v.size(); ++j) {
1288 +
            auto pnt = surf->Value(u[i], v[j]);
1289 +
            points.SetValue(static_cast<Standard_Integer>(i+1), static_cast<Standard_Integer>(j+1), pnt);
1290 +
        }
1291 +
    }
1292 +
1293 +
    return CTiglBSplineAlgorithms::pointsToSurface(points, u, v, true, true);
1294 +
}
1295 +
1142 1296
} // namespace tigl

@@ -189,7 +189,8 @@
Loading
189 189
    surfaces_vector_unmod.push_back(tensorProdSurf);
190 190
191 191
    // create common knot vector for all three surfaces
192 -
    std::vector<Handle(Geom_BSplineSurface)> surfaces_vector = CTiglBSplineAlgorithms::createCommonKnotsVectorSurface(surfaces_vector_unmod);
192 +
    std::vector<Handle(Geom_BSplineSurface)> surfaces_vector = CTiglBSplineAlgorithms::createCommonKnotsVectorSurface(surfaces_vector_unmod,
193 +
                                                                                                                      SurfaceDirection::both);
193 194
194 195
    assert(surfaces_vector.size() == 3);
195 196

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Learn more Showing 9 files with coverage changes found.

New file src/geometry/CTiglConcatSurfaces.h
New
Loading file...
New file src/geometry/CTiglConcatSurfaces.cpp
New
Loading file...
Changes in src/geometry/CTiglBSplineAlgorithms.cpp
-2
+2
Loading file...
Changes in src/wing/CTiglWingProfilePointList.cpp
-1
+1
Loading file...
Changes in src/wing/CCPACSWingProfile.cpp
-1
+1
Loading file...
Changes in src/common/tiglcommonfunctions.cpp
-11
+11
Loading file...
Changes in src/common/Debugging.cpp
-2
+2
Loading file...
Changes in src/guide_curves/CCPACSGuideCurves.cpp
-3
+3
Loading file...
Changes in src/guide_curves/CCPACSGuideCurve.cpp
-6
+6
Loading file...

38 Commits

Hiding 35 contexual commits
+2 Files
+162
+208
-46
Files Coverage
src 0.41% 69.42%
Project Totals (425 files) 69.42%
Loading