Skip to content

Commit fb94c49

Browse files
authored
Merge pull request #519 from xBimTeam/develop
Merge Develop 5.1 to master
2 parents c1c2281 + 2f6e3a6 commit fb94c49

File tree

2,999 files changed

+117631
-125868
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,999 files changed

+117631
-125868
lines changed

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,39 @@
22

33
All notable changes to this project should be documented in this file
44

5+
## [v5.1.785] 2024-12-15
6+
7+
Final 5.1 release before v6 (supporting netcore and IFC4.3)
8+
9+
### Changed
10+
- Updated to OpenCascade 7.5.2
11+
- Switched to v6 Essentials Dependency Injection & Logging
12+
### Added
13+
- Baseline support for IFC4.3 schema (not including new geometries and linear placement)
14+
- BatchProcessor can now mesh single Breps
15+
### Removed
16+
### Fixed
17+
- Better logging on unmanaged exceptions
18+
- Fix for #281: Stackoverflow when precision is incorrect on Wires
19+
- Fixed management of invalid normals
20+
- Fix for collinear points in profiles
21+
- Added null check when trimming faces
22+
- Fix #388 : SurfaceCurveSweptAreaSolid regression
23+
- Fix: Small scale errors would throw exception
24+
- Fix managed objects lifetime (@daniilch)
25+
- Fix: Handle OCC precision issue in BRepTools_WireExplorer (@FrozenKiwi)
26+
- Fix #370: Premature garbage collection of objects holding native resources (@ChernyshevDS)
27+
- Fix infinite loop in ShapeUpgrade_UnifySameDomain
28+
- Security fix: Update Newtonsoft
29+
- Added workaround for ArchiCAD precision issues
30+
- Unique region names for many context w/geometries
31+
- #492 Fix logging when warning about incorrect composite profile
32+
- fixed up IfcCShapeProfileDef error when values of girth and thickness are the same (@okaharu0795)
33+
- Fix #447 Incorrect curve parameters when creating XbimCurve for trimmed ellipse (@ChernyshevDS)
34+
- #512 Fix Memory Access Violation issues (v4 regresion due to use of No_Exceptions)
35+
- Fixes major disparity between Debug and Release builds as OCC was not raising Standard_Failure exceptions in Release build: often triggering unmanagaed 'access violation' exceptions
36+
- #512 Handle invalid AdvancedBreps better when calculating regions
37+
538
## [v5.1.239] 2019-06-03
639

740
Candidate release for 5.1
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
using FluentAssertions;
2+
using Microsoft.Extensions.Logging;
3+
using Microsoft.VisualStudio.TestTools.UnitTesting;
4+
using System;
5+
using System.Drawing;
6+
using System.Linq;
7+
using Xbim.Common.Configuration;
8+
using Xbim.Common.Geometry;
9+
using Xbim.Ifc4.Interfaces;
10+
using Xbim.IO.Memory;
11+
using Xbim.ModelGeometry.Scene;
12+
13+
namespace Xbim.Geometry.Engine.Interop.Tests
14+
{
15+
[TestClass]
16+
public class GithubIssuesTests
17+
{
18+
[TestMethod]
19+
public void Github_Issue_281()
20+
{
21+
// this file resulted in a stack-overflow exception due to precision issues in the data.
22+
// We have added better exception management so that the stack-overflow is not thrown any more,
23+
// however the voids in the wall are still not computed correctly.
24+
//
25+
using (var m = new MemoryModel(new Ifc2x3.EntityFactoryIfc2x3()))
26+
{
27+
m.LoadStep21("TestFiles\\Github\\Github_issue_281_minimal.ifc");
28+
var c = new Xbim3DModelContext(m);
29+
c.CreateContext(null, false);
30+
31+
// todo: 2021: add checks so that the expected openings are correctly computed.
32+
}
33+
}
34+
35+
[TestMethod]
36+
public void Github_Issue_447()
37+
{
38+
// This file contains a trimmed curve based on ellipse which has semiaxis1 < semiaxis2
39+
// and trimmed curve is parameterized with cartesian points.
40+
// This test checks for a bug in XBimCurve geometry creation procedure when incorrect parameter values
41+
// are calculated for these specific conditions described above.
42+
using (var model = MemoryModel.OpenRead(@"TestFiles\Github\Github_issue_447.ifc"))
43+
{
44+
var shape = model.Instances.OfType<IIfcTrimmedCurve>().FirstOrDefault();
45+
Assert.IsNotNull(shape);
46+
var trimPoint1 = shape.Trim1.OfType<IIfcCartesianPoint>().FirstOrDefault();
47+
Assert.IsNotNull(trimPoint1);
48+
var trimPoint2 = shape.Trim2.OfType<IIfcCartesianPoint>().FirstOrDefault();
49+
Assert.IsNotNull(trimPoint2);
50+
51+
var trimStart = new XbimPoint3D(trimPoint1.X, trimPoint1.Y, trimPoint1.Z);
52+
var trimEnd = new XbimPoint3D(trimPoint2.X, trimPoint2.Y, trimPoint2.Z);
53+
54+
IXbimGeometryEngine geomEngine = new XbimGeometryEngine();
55+
var geom = geomEngine.CreateCurve(shape);
56+
Assert.IsNotNull(geom);
57+
58+
Assert.AreEqual(trimStart, geom.Start);
59+
Assert.AreEqual(trimEnd, geom.End);
60+
}
61+
}
62+
63+
[TestMethod]
64+
public void Github_Issue_512()
65+
{
66+
//var loggerFactory = new LoggerFactory().AddConsole(LogLevel.Trace);
67+
//XbimServices.Current.ConfigureServices(s => s.AddXbimToolkit(b => b.AddLoggerFactory(loggerFactory)));
68+
var ifcFile = @"TestFiles\Github\Github_issue_512.ifc";
69+
// Triggers OCC Memory violation
70+
using (var m = MemoryModel.OpenRead(ifcFile))
71+
{
72+
var c = new Xbim3DModelContext(m);
73+
var result = c.CreateContext(null, true);
74+
75+
Assert.IsTrue(result, "Expect success");
76+
77+
Assert.IsFalse(m.GeometryStore.IsEmpty, "Store expected to be full");
78+
}
79+
}
80+
81+
[TestMethod]
82+
public void Github_Issue_512b()
83+
{
84+
//var loggerFactory = new LoggerFactory().AddConsole(LogLevel.Trace);
85+
//Common.Configuration.XbimServices.Current.ConfigureServices(s => s.AddXbimToolkit(b => b.AddLoggerFactory(loggerFactory)));
86+
var ifcFile = @"TestFiles\Github\Github_issue_512b.ifc";
87+
// Triggers OCC Memory violation
88+
using (var m = MemoryModel.OpenRead(ifcFile))
89+
{
90+
var c = new Xbim3DModelContext(m);
91+
var result = c.CreateContext(null, true);
92+
93+
Assert.IsTrue(result, "Expect success");
94+
95+
Assert.IsFalse(m.GeometryStore.IsEmpty, "Store expected to be full");
96+
97+
using (var reader = m.GeometryStore.BeginRead())
98+
{
99+
var regions = reader.ContextRegions.Where(cr => cr.MostPopulated() != null).Select(cr => cr.MostPopulated());
100+
101+
var region = regions.FirstOrDefault();
102+
103+
region.Size.Length.Should().BeApproximately(1.747, 0.001);
104+
}
105+
}
106+
}
107+
108+
//[TestMethod]
109+
110+
//public void Github_Issue_512d()
111+
//{
112+
113+
// var ifcFile = @"C:\Users\AndyWard\XBIM\Models - Documents\0400 Under NDA\TraceSoftware\CDO_EXE_240_ML04_S_1_01.extracted.ifc";
114+
// // Triggers OCC Memory violation
115+
// using (var m = MemoryModel.OpenRead(ifcFile))
116+
// {
117+
// var loggerFactory = new LoggerFactory().AddConsole(LogLevel.Trace);
118+
// var geomEngine = new XbimGeometryEngine();
119+
// var logger = loggerFactory.CreateLogger<GithubIssuesTests>();
120+
121+
// IIfcAdvancedBrep brep = m.Instances[9020] as IIfcAdvancedBrep;
122+
123+
// var geom = geomEngine.CreateSolidSet(brep, logger);
124+
125+
// geom.IsValid.Should().BeTrue();
126+
127+
// foreach(var shape in geom)
128+
// {
129+
// var bb = shape.BoundingBox;
130+
// Console.WriteLine($"{shape.IsValid} {shape.IsPolyhedron} {shape.BoundingBox.Length()} {shape.BoundingBox} ");
131+
// }
132+
// // geom.SaveAsBrep("Foo.brep");
133+
134+
// geom.BoundingBox.Length().Should().BeLessOrEqualTo(1e10);
135+
// }
136+
137+
//}
138+
}
139+
}

0 commit comments

Comments
 (0)