v0.2.18
Primarily Alignment Geometry creation improvement
This commit is contained in:
Родитель
56dd82bf81
Коммит
1d0adc121c
|
@ -1915,6 +1915,7 @@ namespace GeometryGym.Ifc
|
|||
|
||||
public HashSet<string> IgnoredPropertyNames = new HashSet<string>();
|
||||
internal DuplicateCommonDictionaries mCommonObjects = new DuplicateCommonDictionaries();
|
||||
internal HashSet<IfcSpatialElement> mSpatialElementsToDuplicate = new HashSet<IfcSpatialElement>();
|
||||
|
||||
public DuplicateOptions(double deviationTolerance)
|
||||
{
|
||||
|
@ -1941,6 +1942,7 @@ namespace GeometryGym.Ifc
|
|||
IgnoredPropertyNames.Add(propertyName);
|
||||
|
||||
mCommonObjects = options.mCommonObjects;
|
||||
mSpatialElementsToDuplicate = options.mSpatialElementsToDuplicate;
|
||||
}
|
||||
}
|
||||
internal class DuplicateCommonDictionaries
|
||||
|
|
|
@ -674,10 +674,8 @@ namespace GeometryGym.Ifc
|
|||
}
|
||||
else
|
||||
{
|
||||
IfcShapeRepresentation axisRepresentation = alignment.Representation.Representations.
|
||||
OfType<IfcShapeRepresentation>().
|
||||
Where(x => string.Compare(x.RepresentationIdentifier, context.ContextIdentifier, true) == 0).
|
||||
FirstOrDefault();
|
||||
IfcShapeRepresentation axisRepresentation = alignment.Representation.Representations.OfType<IfcShapeRepresentation>().
|
||||
Where(x => string.Compare(x.RepresentationIdentifier, context.ContextIdentifier, true) == 0).FirstOrDefault();
|
||||
|
||||
if (axisRepresentation == null)
|
||||
{
|
||||
|
@ -685,7 +683,10 @@ namespace GeometryGym.Ifc
|
|||
alignment.Representation.Representations.Add(axisRepresentation);
|
||||
}
|
||||
else
|
||||
{
|
||||
axisRepresentation.Items.Clear();
|
||||
axisRepresentation.Items.Add(segmentedReferenceCurve);
|
||||
}
|
||||
}
|
||||
}
|
||||
return segmentedReferenceCurve;
|
||||
|
@ -869,7 +870,6 @@ namespace GeometryGym.Ifc
|
|||
}
|
||||
public IfcCompositeCurve ComputeHorizontalGeometry(IfcAlignment alignment)
|
||||
{
|
||||
double tol = mDatabase.Tolerance;
|
||||
List<IfcCurveSegment> curveSegments = new List<IfcCurveSegment>();
|
||||
List<IfcAlignmentHorizontalSegment> horizontalSegments = HorizontalSegments.ToList();
|
||||
if (horizontalSegments.Count == 0)
|
||||
|
@ -880,14 +880,16 @@ namespace GeometryGym.Ifc
|
|||
try
|
||||
{
|
||||
IfcAlignmentHorizontalSegment nextSegment = counter + 1 < segmentCount ? horizontalSegments[counter + 1] : null;
|
||||
curveSegments.Add(horizontalSegments[counter].generateCurveSegment(nextSegment));
|
||||
IfcCurveSegment curveSegment = horizontalSegments[counter].generateCurveSegment(nextSegment);
|
||||
if(curveSegment != null)
|
||||
curveSegments.Add(curveSegment);
|
||||
}
|
||||
catch (Exception) { }
|
||||
}
|
||||
IfcCompositeCurve compositeCurve = new IfcCompositeCurve(curveSegments);
|
||||
if (alignment != null)
|
||||
{
|
||||
var subContext = mDatabase.Factory.SubContext(IfcGeometricRepresentationSubContext.SubContextIdentifier.FootPrint);
|
||||
var subContext = mDatabase.Factory.SubContext(IfcGeometricRepresentationSubContext.SubContextIdentifier.Axis);
|
||||
IfcShapeRepresentation shapeRepresentation = new IfcShapeRepresentation(subContext, compositeCurve, ShapeRepresentationType.Curve2D);
|
||||
if (alignment.Representation == null)
|
||||
alignment.Representation = new IfcProductDefinitionShape(shapeRepresentation);
|
||||
|
@ -980,8 +982,9 @@ namespace GeometryGym.Ifc
|
|||
{
|
||||
DatabaseIfc db = mDatabase;
|
||||
double tol = db.Tolerance;
|
||||
if (SegmentLength < tol)
|
||||
return null;
|
||||
Tuple<double, double> startTangent = StartTangent();
|
||||
|
||||
IfcCartesianPoint startPoint = StartPoint;
|
||||
|
||||
IfcAxis2Placement2D placement = new IfcAxis2Placement2D(startPoint) { RefDirection = new IfcDirection(db, startTangent.Item1, startTangent.Item2) };
|
||||
|
@ -1246,11 +1249,21 @@ namespace GeometryGym.Ifc
|
|||
if (alignment != null)
|
||||
{
|
||||
var subContext = mDatabase.Factory.SubContext(IfcGeometricRepresentationSubContext.SubContextIdentifier.Axis);
|
||||
|
||||
IfcShapeRepresentation shapeRepresentation = new IfcShapeRepresentation(subContext, gradientCurve, ShapeRepresentationType.Curve3D);
|
||||
if (alignment.Representation == null)
|
||||
alignment.Representation = new IfcProductDefinitionShape(shapeRepresentation);
|
||||
else
|
||||
{
|
||||
IfcShapeRepresentation axisShape = alignment.Representation.Representations.Where(x => string.Compare(x.RepresentationIdentifier, "Axis", true) == 0).FirstOrDefault() as IfcShapeRepresentation;
|
||||
if(axisShape != null)
|
||||
{
|
||||
var footPrintContext = mDatabase.Factory.SubContext(IfcGeometricRepresentationSubContext.SubContextIdentifier.FootPrint);
|
||||
axisShape.ContextOfItems = footPrintContext;
|
||||
axisShape.RepresentationIdentifier = footPrintContext.ContextIdentifier;
|
||||
}
|
||||
alignment.Representation.Representations.Add(shapeRepresentation);
|
||||
}
|
||||
}
|
||||
return gradientCurve;
|
||||
}
|
||||
|
|
|
@ -320,6 +320,12 @@ namespace GeometryGym.Ifc
|
|||
{
|
||||
DuplicateOptions downstreamOptions = new DuplicateOptions(options) { DuplicateHost = true };
|
||||
|
||||
if(o is IfcSpatialElement spatialElement && !options.mSpatialElementsToDuplicate.Contains(spatialElement))
|
||||
{
|
||||
List<IfcSpatialElement> nestedSpatialElements = spatialElement.Extract<IfcSpatialElement>();
|
||||
foreach(IfcSpatialElement spatial in nestedSpatialElements)
|
||||
downstreamOptions.mSpatialElementsToDuplicate.Add(spatial);
|
||||
}
|
||||
foreach (IfcRelAggregates rag in o.mIsDecomposedBy)
|
||||
{
|
||||
foreach(IfcObjectDefinition obj in rag.RelatedObjects)
|
||||
|
|
|
@ -1508,7 +1508,8 @@ namespace GeometryGym.Ifc
|
|||
internal IfcRelContainedInSpatialStructure(DatabaseIfc db, IfcRelContainedInSpatialStructure r, DuplicateOptions options)
|
||||
: base(db, r, options)
|
||||
{
|
||||
RelatingStructure = db.Factory.Duplicate(r.RelatingStructure, new DuplicateOptions(options) { DuplicateDownstream = false });
|
||||
DuplicateOptions relatingOptions = new DuplicateOptions(options) { DuplicateDownstream = options.mSpatialElementsToDuplicate.Contains(r.RelatingStructure) };
|
||||
RelatingStructure = db.Factory.Duplicate(r.RelatingStructure, relatingOptions);
|
||||
if (options.DuplicateDownstream)
|
||||
{
|
||||
DuplicateOptions optionsNoHost = new DuplicateOptions(options) { DuplicateHost = false };
|
||||
|
|
|
@ -20,8 +20,8 @@ using System.Reflection;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyVersion("0.2.17.0")]
|
||||
[assembly: AssemblyFileVersion("0.2.17.0")]
|
||||
[assembly: AssemblyVersion("0.2.18.0")]
|
||||
[assembly: AssemblyFileVersion("0.2.18.0")]
|
||||
|
||||
[assembly: AssemblyTitle("GeometryGymIFC")]
|
||||
[assembly: AssemblyDescription("C# classes to generate and parse buildingSMART IFC (Industry Foundation Class) files")]
|
||||
|
|
|
@ -20,8 +20,8 @@ using System.Reflection;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyVersion("0.2.17.0")]
|
||||
[assembly: AssemblyFileVersion("0.2.17.0")]
|
||||
[assembly: AssemblyVersion("0.2.18.0")]
|
||||
[assembly: AssemblyFileVersion("0.2.18.0")]
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<PackageId>GeometryGymIFC_Core</PackageId>
|
||||
<Version>0.2.17</Version>
|
||||
<Version>0.2.18</Version>
|
||||
<Authors>Geometry Gym</Authors>
|
||||
<Product>GeometryGymIFC_Core</Product>
|
||||
<Description>.Net Standard 2.0 C# classes to generate and parse buildingSMART IFC (Industry Foundation Class) files
|
||||
|
@ -14,8 +14,8 @@ License https://github.com/GeometryGym/GeometryGymIFC/blob/master/LICENSE</Descr
|
|||
<PackageProjectUrl></PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/GeometryGym/GeometryGymIFC</RepositoryUrl>
|
||||
<PackageTags>BIM, IFC, openBIM</PackageTags>
|
||||
<AssemblyVersion>0.2.17.0</AssemblyVersion>
|
||||
<FileVersion>0.2.17.0</FileVersion>
|
||||
<AssemblyVersion>0.2.18.0</AssemblyVersion>
|
||||
<FileVersion>0.2.18.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
|
|
Загрузка…
Ссылка в новой задаче