diff --git a/Xbim.Geometry.Engine.Interop/Xbim.Geometry.Engine.Interop.csproj b/Xbim.Geometry.Engine.Interop/Xbim.Geometry.Engine.Interop.csproj
index 6d162d834..2dbb95965 100644
--- a/Xbim.Geometry.Engine.Interop/Xbim.Geometry.Engine.Interop.csproj
+++ b/Xbim.Geometry.Engine.Interop/Xbim.Geometry.Engine.Interop.csproj
@@ -50,7 +50,7 @@
-
+
diff --git a/Xbim.Geometry.Engine.Interop/XbimCustomAssemblyResolver.cs b/Xbim.Geometry.Engine.Interop/XbimCustomAssemblyResolver.cs
index 37338fdd3..261e2a341 100644
--- a/Xbim.Geometry.Engine.Interop/XbimCustomAssemblyResolver.cs
+++ b/Xbim.Geometry.Engine.Interop/XbimCustomAssemblyResolver.cs
@@ -40,8 +40,8 @@ private static Assembly ProbeForAssembly(string moduleName)
{
_logger.LogDebug("Getting probing path from executing assembly");
Assembly assembly = Assembly.GetExecutingAssembly(); // The Xbim.Geometry.Engine.Interop assembly
- // code base always points to the deployed DLL, which may be different to the executing Location because of Shadow Copying in the AppDomain (e.g. ASP.NET)
- var codepath = new Uri(assembly.CodeBase);
+ // Location always points to the deployed DLL, which may be different to the executing Location because of Shadow Copying in the AppDomain (e.g. ASP.NET)
+ var codepath = new Uri(assembly.Location);
// Unlike Assembly.Location, CodeBase is a URI [file:\\c:\wwwroot\etc\WebApp\bin\Xbim.Geometry.Engine.Interop.dll]
appDir = Path.GetDirectoryName(codepath.LocalPath);
}
diff --git a/Xbim.Geometry.Engine.Interop/XbimGeometryEngine.cs b/Xbim.Geometry.Engine.Interop/XbimGeometryEngine.cs
index bc1988e72..7f0ec85cd 100644
--- a/Xbim.Geometry.Engine.Interop/XbimGeometryEngine.cs
+++ b/Xbim.Geometry.Engine.Interop/XbimGeometryEngine.cs
@@ -34,8 +34,6 @@ public XbimGeometryEngine(ILogger logger)
{
_logger = logger ?? XbimLogging.CreateLogger();
- // Warn if runtime for Engine is not present, this is not necessary any more as we are net47
-
#if DELAY_LOAD
var conventions = new XbimArchitectureConventions(); // understands the process we run under
@@ -818,6 +816,18 @@ public string ToBrep(IXbimGeometryObject geometryObject)
}
}
+ public void WriteBrep(string filename, IXbimGeometryObject geomObj)
+ {
+ // no logger is provided so no tracing is started for this function
+ _engine.WriteBrep(filename, geomObj);
+ }
+
+ public IXbimGeometryObject ReadBrep(string filename)
+ {
+ // no logger is provided so no tracing is started for this function
+ return _engine.ReadBrep(filename);
+ }
+
public IXbimSolidSet CreateSolidSet(IIfcSweptAreaSolid ifcSolid, ILogger logger = null)
{
using (new Tracer(LogHelper.CurrentFunctionName(), this._logger, ifcSolid))
diff --git a/Xbim.Geometry.Engine/OCC/src/BRepTools/BRepTools_WireExplorer.cxx b/Xbim.Geometry.Engine/OCC/src/BRepTools/BRepTools_WireExplorer.cxx
index 1fe412abe..263f8dfa7 100644
--- a/Xbim.Geometry.Engine/OCC/src/BRepTools/BRepTools_WireExplorer.cxx
+++ b/Xbim.Geometry.Engine/OCC/src/BRepTools/BRepTools_WireExplorer.cxx
@@ -751,6 +751,9 @@ Standard_Real GetNextParamOnPC(const Handle(Geom2d_Curve)& aPC,
{
Standard_Real result = ( reverse ) ? fP : lP;
Standard_Real dP = Abs( lP - fP ) / 1000.; // was / 16.;
+ // Ensure incrememt is large enough to effect startPar
+ Standard_Real resolution = Abs(fP / Pow(2, 52));
+ dP = Max(dP, resolution);
if( reverse )
{
Standard_Real startPar = fP;
diff --git a/Xbim.Geometry.Engine/OCC/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx b/Xbim.Geometry.Engine/OCC/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx
index 010386c99..613ac1443 100644
--- a/Xbim.Geometry.Engine/OCC/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx
+++ b/Xbim.Geometry.Engine/OCC/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx
@@ -315,10 +315,12 @@ static void RelocatePCurvesToNewUorigin(const TopTools_SequenceOfShape& theEdges
for (;;) //collect pcurves of a contour
{
RemoveEdgeFromMap(CurEdge, theVEmap);
- theUsedEdges.Add(CurEdge);
+ Standard_Boolean notUsed = theUsedEdges.Add(CurEdge);
+ if (!notUsed)
+ break;
TopoDS_Vertex CurVertex = (anOr == TopAbs_FORWARD)?
TopExp::LastVertex(CurEdge, Standard_True) : TopExp::FirstVertex(CurEdge, Standard_True);
-
+
const TopTools_ListOfShape& Elist = theVEmap.FindFromKey(CurVertex);
if (Elist.IsEmpty())
break; //end of contour in 3d
diff --git a/Xbim.Geometry.Engine/XbimFace.cpp b/Xbim.Geometry.Engine/XbimFace.cpp
index 3594691ca..b5321ffac 100644
--- a/Xbim.Geometry.Engine/XbimFace.cpp
+++ b/Xbim.Geometry.Engine/XbimFace.cpp
@@ -1780,38 +1780,33 @@ namespace Xbim
//trim 1 and trim 2 will be cartesian points
IIfcCartesianPoint^ trim1 = dynamic_cast(Enumerable::FirstOrDefault(tc->Trim1));
IIfcCartesianPoint^ trim2 = dynamic_cast(Enumerable::FirstOrDefault(tc->Trim2));
- gp_Pnt p1 = XbimConvert::GetPoint3d(trim1);
- gp_Pnt p2 = XbimConvert::GetPoint3d(trim2);
- //there are two solutions A, B
- //calc solution A
- double radsq = circle->Radius * circle->Radius;
- double qX = System::Math::Sqrt(((p2.X() - p1.X()) * (p2.X() - p1.X())) + ((p2.Y() - p1.Y()) * (p2.Y() - p1.Y())));
- double x3 = (p1.X() + p2.X()) / 2;
- double centreX = x3 - System::Math::Sqrt(radsq - ((qX / 2) * (qX / 2))) * ((p1.Y() - p2.Y()) / qX);
-
- double qY = System::Math::Sqrt(((p2.X() - p1.X()) * (p2.X() - p1.X())) + ((p2.Y() - p1.Y()) * (p2.Y() - p1.Y())));
-
- double y3 = (p1.Y() + p2.Y()) / 2;
-
- double centreY = y3 - System::Math::Sqrt(radsq - ((qY / 2) * (qY / 2))) * ((p2.X() - p1.X()) / qY);
-
-
-
- ITransaction^ txn = sLin->Model->BeginTransaction("Fix Centre");
-
-
- IIfcPlacement^ p = dynamic_cast(circle->Position);
-
- p->Location->Coordinates[0] = centreX;
- p->Location->Coordinates[1] = centreY;
- p->Location->Coordinates[2] = 0;
-
- xbasisEdge1 = gcnew XbimEdge(sLin->SweptCurve, logger);
- txn->RollBack();
- isFixed = true;
+ if (trim1 != nullptr && trim2 != nullptr)
+ {
+ gp_Pnt p1 = XbimConvert::GetPoint3d(trim1);
+ gp_Pnt p2 = XbimConvert::GetPoint3d(trim2);
+ //there are two solutions A, B
+ //calc solution A
+ double radsq = circle->Radius * circle->Radius;
+ double qX = System::Math::Sqrt(((p2.X() - p1.X()) * (p2.X() - p1.X())) + ((p2.Y() - p1.Y()) * (p2.Y() - p1.Y())));
+ double x3 = (p1.X() + p2.X()) / 2;
+ double centreX = x3 - System::Math::Sqrt(radsq - ((qX / 2) * (qX / 2))) * ((p1.Y() - p2.Y()) / qX);
+
+ double qY = System::Math::Sqrt(((p2.X() - p1.X()) * (p2.X() - p1.X())) + ((p2.Y() - p1.Y()) * (p2.Y() - p1.Y())));
+ double y3 = (p1.Y() + p2.Y()) / 2;
+ double centreY = y3 - System::Math::Sqrt(radsq - ((qY / 2) * (qY / 2))) * ((p2.X() - p1.X()) / qY);
+
+ ITransaction^ txn = sLin->Model->BeginTransaction("Fix Centre");
+
+ IIfcPlacement^ p = dynamic_cast(circle->Position);
+ p->Location->Coordinates[0] = centreX;
+ p->Location->Coordinates[1] = centreY;
+ p->Location->Coordinates[2] = 0;
+
+ xbasisEdge1 = gcnew XbimEdge(sLin->SweptCurve, logger);
+ txn->RollBack();
+ isFixed = true;
+ }
}
-
-
}
if (!isFixed) //just build it
xbasisEdge1 = gcnew XbimEdge(sLin->SweptCurve, logger);
diff --git a/Xbim.Geometry.Engine/XbimGeometryCreator.cpp b/Xbim.Geometry.Engine/XbimGeometryCreator.cpp
index 510ed6168..5394bc057 100644
--- a/Xbim.Geometry.Engine/XbimGeometryCreator.cpp
+++ b/Xbim.Geometry.Engine/XbimGeometryCreator.cpp
@@ -99,7 +99,21 @@ namespace Xbim
LoggerExtensions::LogDebug(logger, "GeomEngine: {0} [{1}]", entity->GetType()->Name, msg);
}
}
+
+ void XbimGeometryCreator::WriteBrep(System::String^ filename, IXbimGeometryObject^ geomObj)
+ {
+ throw gcnew System::NotImplementedException();
+ // TODO: This is stubbed out until we merge the implementation from unpushed code.
+ // temp fix for broken build
+ }
+ IXbimGeometryObject^ XbimGeometryCreator::ReadBrep(System::String^ filename)
+ {
+ throw gcnew System::NotImplementedException();
+ // TODO: This is stubbed out until we merge the implementation from unpushed code.
+ // temp fix for broken build
+ }
+
void XbimGeometryCreator::LogError(ILogger^ logger, Object^ entity, System::String^ format, ...array