Skip to content

Commit 8ae1b01

Browse files
Fix error message and default merge tolerance (#400)
2 parents ef9ff1d + 4540e58 commit 8ae1b01

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Lusas_Adapter/CRUD/Create/Elements/Surface.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,21 @@ private IFSurface CreateSurface(Panel panel)
8181

8282
if (string.IsNullOrEmpty(openingID))
8383
{
84-
Engine.Base.Compute.RecordError($"Could not find the ids for at least one of the Openings on Surface {GetAdapterId<string>(panel)}, Opening not created.");
84+
Engine.Base.Compute.RecordError($"Could not find the ids for at least one of the Openings on Panel {lusasSurface.getID()}, this Opening has not been created.");
8585
continue;
8686
}
8787

8888

8989
if (EdgeIntersection(opening.Edges, panel.ExternalEdges))
9090
{
91-
Engine.Base.Compute.RecordError($"At least one Edge defining the Panel {GetAdapterId<string>(panel)} intersects with at least one Edge defining the Opening {GetAdapterId<string>(opening)}, Opening not created.");
91+
Engine.Base.Compute.RecordError($"At least one Edge defining Panel {lusasSurface.getID()} intersects with at least one Edge defining an Opening, this Opening has not been created.");
9292
continue;
9393
}
9494

9595

9696
if (!Engine.Geometry.Query.IsCoplanar(opening.FitPlane(), panel.FitPlane(), m_mergeTolerance))
9797
{
98-
Engine.Base.Compute.RecordError($"The geometry defining the Panel {GetAdapterId<string>(panel)} is not Coplanar the Opening {GetAdapterId<string>(opening)}, Opening not created.");
98+
Engine.Base.Compute.RecordError($"The geometry defining Panel {lusasSurface.getID()} is not Coplanar with an Opening, this Opening has not been created.");
9999
continue;
100100
}
101101

@@ -149,10 +149,6 @@ private IFSurface CreateSurface(Panel panel)
149149
return lusasSurface;
150150
}
151151

152-
/***************************************************/
153-
/**** Private Methods ****/
154-
/***************************************************/
155-
156152
private static bool EdgeIntersection(List<Edge> openingEdges, List<Edge> panelEdges)
157153
{
158154
foreach (Edge openingEdge in openingEdges)

Lusas_Adapter/LusasAdapter.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ public LusasV17Adapter(string filePath, LusasSettings lusasSettings = null, bool
176176
m_mergeTolerance = lusasSettings.MergeTolerance;
177177
d_LusasData.getOptions().setDouble("TOLMRG", m_mergeTolerance);
178178
}
179+
else
180+
{
181+
Engine.Base.Compute.RecordWarning($"A merge tolerance has not been set and the default value of {Tolerance.Distance} has been used.");
182+
}
179183

180184
if (lusasSettings != null) { m_g = lusasSettings.StandardGravity; }
181185
}
@@ -198,7 +202,7 @@ public static bool IsApplicationRunning()
198202
//Add any comlink object as a private field here, example named:
199203

200204
private string m_directory;
201-
public double m_mergeTolerance = double.NaN;
205+
public double m_mergeTolerance = Tolerance.Distance;
202206
public double m_g = 9.80665;
203207
public LusasWinApp m_LusasApplication;
204208
public IFDatabase d_LusasData;

0 commit comments

Comments
 (0)