Skip to content

Commit

Permalink
Merge branch 'master' into cpacs_creator_dev_merge
Browse files Browse the repository at this point in the history
  • Loading branch information
svengoldberg committed Nov 19, 2024
2 parents bd076e7 + b9c75f1 commit cdb68dc
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
- [ ] The new code complies with the TiGL style guide.
- [ ] New classes have been added to the Python interface.
- [ ] API changes were documented properly in tigl.h.
- [ ] Changes were documented in tigl/ChangeLog.md
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ endif()

cmake_minimum_required (VERSION 3.11.0)

project (TIGL VERSION 3.3.1)
set(TIGL_VERSION 3.3.1)
project (TIGL VERSION 3.4.0)
set(TIGL_VERSION 3.4.0)

# enable C++11 support
set(CMAKE_CXX_STANDARD 11)
Expand Down
24 changes: 24 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
Changelog
=========

Changes since last release
-------------
13/11/2024

- Fixes:
- In #1026, the tolerance for creating cells via contourCoordinate was reduced for cells in spanwise direction. That fixed a bug that caused cells to overlap potentially. The same reduction was missed in chordwise direction and is added now to avoid the cell overlap in chordwise direction, as well. (#1034)


Version 3.4.0
-------------
12/11/2024

- General changes:

- Support CPACS 3.4 (#1027)
- Implemented standard fuselage profiles, i.e. rounded rectangle profiles (#1005) and superellipses (#1021).
- CPACS allows prescribing kinks at (fuselage) profiles at given parameters. At the same time, guide curves must be prescribed at a relative circumference of the profile, which does not necessarily coincide with the parametrization of the profiles. In consequence, it was nearly impossible for a user to prescribe a guide curve exactly at a profile kink. This was fixed by allowing guide curves to be placed at a curve parameter that coincides with the prescribed parameter in the profile definition. Now guide curves can optionally be prescribed using `fromParameter ` and `toParameter` instead of `fromRelativeCircumference` and `toRelativeCircumference`. (#1015)

- Fixes:
- In Debug Mode, the Lofting algorithm now throws an exception, if the generation of the Side Caps fail. The intention behind having the check only in Debug-Mode is that the geometric validity check is very generic and may be too restrictive. In addition, it may be expensive. (#999)
- Fixed an issue, where approximate reparametrization of a B-Spline Curve resulted in non-negligable geometric changes of the B-Spline, especially if parameters are prescribed for a profile in CPACS. This new reparametrization is incompatible with a previous reparametrization applied to fuselage profiles, that distributed the knots for an overall cleaner geometry. Now the knot distribution is turned off, if parameters are prescribed in CPACS. (#1007)
- CPACS 3.5 introduces a new way of prescribing the version of the CPACS data set, which means that newer CPACS files could not be interpreted by TiGL anymore. Now, TiGL can open CPACS 3.5 files and raises a warning that the CPACS version is newer than the one supported by TiGL (#1010).
- Fix hard crash in Wing Geometry generation with cutouts, if there are no cutouts defined in CPACS. (#1023)

Version 3.3.1
-------------
14/03/2024
Expand Down
4 changes: 2 additions & 2 deletions src/wing/CCPACSWingCell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -912,8 +912,8 @@ void CCPACSWingCell::BuildSkinGeometry(GeometryCache& cache) const
*/
TrimSpanwise(cache, SpanWiseBorder::Inner, m_positioningInnerBorder, 1e-4);
TrimSpanwise(cache, SpanWiseBorder::Outer, m_positioningOuterBorder, 1e-4);
TrimChordwise(cache, ChordWiseBorder::LE, m_positioningLeadingEdge, 1e-2);
TrimChordwise(cache, ChordWiseBorder::TE, m_positioningTrailingEdge, 1e-2);
TrimChordwise(cache, ChordWiseBorder::LE, m_positioningLeadingEdge, 1e-4);
TrimChordwise(cache, ChordWiseBorder::TE, m_positioningTrailingEdge, 1e-4);

TopoDS_Builder builder;
TopoDS_Compound resultShape;
Expand Down
64 changes: 63 additions & 1 deletion tests/unittests/tiglWingCell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ TEST(WingCell, IsConvex)
ASSERT_TRUE(cell.IsConvex());
}

TEST(WingCell, IssueCellsNoOverlap)
TEST(WingCell, IssueCellsNoOverlapSpanwise)
{
std::string fileName = "TestData/IEA-22-280-RWT_DLR_loads_CPACS.xml";
std::string configName = "aircraft";
Expand Down Expand Up @@ -169,3 +169,65 @@ TEST(WingCell, IssueCellsNoOverlap)
ASSERT_NEAR(pntCurve1.Y(), pntCurve2.Y(), 1e-3);
ASSERT_NEAR(pntCurve1.Z(), pntCurve2.Z(), 1e-3);
}

TEST(WingCell, IssueCellsNoOverlapChordwise)
{
std::string fileName = "TestData/IEA-22-280-RWT_DLR_loads_CPACS.xml";
std::string configName = "aircraft";
std::string cell1Name = "span03_circ01";
std::string cell2Name = "span03_circ02";

ReturnCode tixiRet;
TiglReturnCode tiglRet;
Standard_Real first1, last1, first2, last2;
gp_Pnt pntCurve1, pntCurve2;

TiglCPACSConfigurationHandle tiglHandle = -1;
TixiDocumentHandle tixiHandle = -1;

tixiRet = tixiOpenDocument(fileName.c_str(), &tixiHandle);
ASSERT_TRUE(tixiRet == SUCCESS);

tiglRet = tiglOpenCPACSConfiguration(tixiHandle, configName.c_str(), &tiglHandle);
ASSERT_TRUE(tiglRet == TIGL_SUCCESS);

auto& uid_mgr = tigl::CCPACSConfigurationManager::GetInstance().GetConfiguration(tiglHandle).GetUIDManager();

auto& cell1 = uid_mgr.ResolveObject<tigl::CCPACSWingCell>(cell1Name.c_str());
TopoDS_Shape cellLoft1 = cell1.GetLoft()->Shape();

auto& cell2 = uid_mgr.ResolveObject<tigl::CCPACSWingCell>(cell2Name.c_str());
TopoDS_Shape cellLoft2 = cell2.GetLoft()->Shape();

// Take the first cell's edge adjacent to cell 2 and the second cell's edge adjacent to cell 1 (-> Should be shared edge)
// If these edges are identical, the cut of the cells is exactely defined by this edge
// Hence, the cells have no overlap
// In the following, the edges are compared by comparing three points at parameters 0, 0.5 and 1
// If the resulting points are pairwise the same (up to tolerance), the edges are the same and the cells do not overlap
TopTools_IndexedMapOfShape edges1, edges2;
TopExp::MapShapes (cellLoft1, TopAbs_EDGE, edges1);
TopExp::MapShapes (cellLoft2, TopAbs_EDGE, edges2);

TopoDS_Edge edge1 = TopoDS::Edge(edges1(1));
TopoDS_Edge edge2 = TopoDS::Edge(edges2(3));
Handle(Geom_BSplineCurve) curve1 = Handle(Geom_BSplineCurve)::DownCast(BRep_Tool::Curve(edge1, first1, last1));
Handle(Geom_BSplineCurve) curve2 = Handle(Geom_BSplineCurve)::DownCast(BRep_Tool::Curve(edge2, first2, last2));

curve1->D0(0., pntCurve1);
curve2->D0(0., pntCurve2);
ASSERT_NEAR(pntCurve1.X(), pntCurve2.X(), 1e-3);
ASSERT_NEAR(pntCurve1.Y(), pntCurve2.Y(), 1e-3);
ASSERT_NEAR(pntCurve1.Z(), pntCurve2.Z(), 1e-3);

curve1->D0(0.5, pntCurve1);
curve2->D0(0.5, pntCurve2);
ASSERT_NEAR(pntCurve1.X(), pntCurve2.X(), 1e-3);
ASSERT_NEAR(pntCurve1.Y(), pntCurve2.Y(), 1e-3);
ASSERT_NEAR(pntCurve1.Z(), pntCurve2.Z(), 1e-3);

curve1->D0(1., pntCurve1);
curve2->D0(1., pntCurve2);
ASSERT_NEAR(pntCurve1.X(), pntCurve2.X(), 1e-3);
ASSERT_NEAR(pntCurve1.Y(), pntCurve2.Y(), 1e-3);
ASSERT_NEAR(pntCurve1.Z(), pntCurve2.Z(), 1e-3);
}

0 comments on commit cdb68dc

Please sign in to comment.