Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added merging tolerance within LusasConfig to apply to both the comparers and the software #374

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
107c089
Added Mergingtolerance double variable to LusasConfig. Default value …
KalleEdstroem Oct 16, 2023
8f19557
Changed name from MergingTolerance to MergeTolerance to align with Lu…
KalleEdstroem Oct 16, 2023
f8b98d3
Changed variable name for consistency
KalleEdstroem Oct 17, 2023
af75fd5
Added description of input. Changed deafult value to come from Tolera…
KalleEdstroem Oct 18, 2023
24b09f3
Added reference and changed default value
KalleEdstroem Oct 18, 2023
5610cb1
Added referance BH.oM.Geometry. Setting default value of MergeTolerance
KalleEdstroem Oct 19, 2023
be66a59
Added m_mergeTolerance. Sets the Lusas Merge Tolerance when running N…
KalleEdstroem Nov 1, 2023
eb1b37a
Changed reference code to follow rest of the project.
KalleEdstroem Nov 1, 2023
993e195
Changed default value of m_mergeTolerance. Removed if statement from …
KalleEdstroem Nov 1, 2023
3ab913f
Made mergeTolerance a mandatory input to LusasConfig.
KalleEdstroem Nov 2, 2023
0b71086
Changes to ensure correct tolerance assignment for all possible cases
KalleEdstroem Nov 2, 2023
13b3069
Changed name from LusasConfig to LusasSettings. Made LusasSettings in…
KalleEdstroem Nov 2, 2023
2da9564
Renaming for all other LusasAdapters
KalleEdstroem Nov 2, 2023
f90fb71
Versioning
KalleEdstroem Nov 2, 2023
d1881c3
Versioning updates
KalleEdstroem Nov 2, 2023
e9aeffe
Versioning update
KalleEdstroem Nov 2, 2023
cd15355
Versioning updates.
KalleEdstroem Nov 7, 2023
710d482
Versioning updates
KalleEdstroem Nov 7, 2023
02611d3
Versioning updates
KalleEdstroem Nov 8, 2023
62db780
Versioning update to have the right BHoM version.
KalleEdstroem Nov 9, 2023
4d223c9
Added json file and message for deleting LusasConfig object.
KalleEdstroem Nov 14, 2023
ff0f2ca
Versioning update.
KalleEdstroem Nov 14, 2023
8058dd4
Added descriptions and small change in reason for deletion message
KalleEdstroem Nov 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Lusas_Adapter/LusasAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ public LusasV17Adapter(string filePath, LusasConfig lusasConfig = null, bool act
{
throw new Exception("An exception has been flagged by Lusas, it is likely the file is from a higher version of Lusas than the adapter being used.");
}

if (lusasConfig != null)
{
d_LusasData.getOptions().setDouble("TOLMRG", lusasConfig.MergeTolerance);
}
KalleEdstroem marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion Lusas_Engine/Create/LusasConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*/

using BH.oM.Adapters.Lusas;
using BH.oM.Geometry;

namespace BH.Engine.Adapters.Lusas
{
Expand All @@ -30,12 +31,15 @@ public static partial class Create
/**** Public Constructors ****/
/***************************************************/

public static LusasConfig LusasConfig(LibrarySettings librarySettings = null)
public static LusasConfig LusasConfig(LibrarySettings librarySettings = null, double mergeTolerance = Tolerance.Distance)
{
LusasConfig lusasConfig = new LusasConfig();
if (librarySettings != null)
lusasConfig.LibrarySettings = librarySettings;

if (mergeTolerance != double.NaN)
lusasConfig.MergeTolerance = mergeTolerance;

return lusasConfig;
}
/***************************************************/
Expand Down
8 changes: 6 additions & 2 deletions Lusas_oM/Lusas_oM.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -134,6 +134,10 @@
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Geometry_oM, Version=6.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\BHoM\Assemblies\Geometry_oM.dll</HintPath>
KalleEdstroem marked this conversation as resolved.
Show resolved Hide resolved
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
Expand Down Expand Up @@ -170,4 +174,4 @@ xcopy "$(TargetDir)$(TargetFileName)" "C:\ProgramData\BHoM\Assemblies" /Y
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
5 changes: 5 additions & 0 deletions Lusas_oM/Settings/LusasConfig.cs
KalleEdstroem marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*/

using BH.oM.Base;
using System.ComponentModel;
using BH.oM.Geometry;

namespace BH.oM.Adapters.Lusas
{
Expand All @@ -32,6 +34,9 @@ public class LusasConfig : BHoMObject

public virtual LibrarySettings LibrarySettings { get; set; } = new LibrarySettings();

[Description("Sets the merging tolerance in Lusas and the distance comparers used by the Lusas_Adapter.")]
public virtual double MergeTolerance { get; set; } = Tolerance.Distance;

/***************************************************/
}
}
Expand Down