/// <summary> /// Indicates whether we are required to create a solid /// </summary> /// <returns>True if we are required to create a solid, false otherwise</returns> public bool MustCreateSolid() { if (BuilderType == IFCShapeBuilderType.TessellatedShapeBuilder) { TessellatedShapeBuilderScope bs = BuilderScope as TessellatedShapeBuilderScope; return(bs.TargetGeometry == TessellatedShapeBuilderTarget.Solid && bs.FallbackGeometry == TessellatedShapeBuilderFallback.Abort); } return(false); }
/// <summary> /// Get the tolerance to be used when determining if a polygon has too short an edge /// for either solid or mesh output.</summary> /// <returns>The tolerance value.</returns> public double GetShortSegmentTolerance() { if (BuilderType != IFCShapeBuilderType.TessellatedShapeBuilder) { return(Document.Application.ShortCurveTolerance); } TessellatedShapeBuilderScope bs = BuilderScope as TessellatedShapeBuilderScope; return((bs.TargetGeometry == TessellatedShapeBuilderTarget.Mesh) ? MathUtil.Eps() : Document.Application.ShortCurveTolerance); }
/// <summary> /// Indicates whether we are attempting to create a solid as our primary target /// </summary> /// <returns>True if we are first trying to create a Solid, false otherwise</returns> public bool TryToCreateSolid() { if (BuilderType == IFCShapeBuilderType.TessellatedShapeBuilder) { TessellatedShapeBuilderScope bs = BuilderScope as TessellatedShapeBuilderScope; return(bs.TargetGeometry == TessellatedShapeBuilderTarget.AnyGeometry || bs.TargetGeometry == TessellatedShapeBuilderTarget.Solid); } else { return(true); } }
/// <summary> /// Indicates whether we are required to create a solid /// </summary> /// <returns>True if we are required to create a solid, false otherwise</returns> public bool MustCreateSolid() { if (BuilderType == IFCShapeBuilderType.TessellatedShapeBuilder) { TessellatedShapeBuilderScope bs = BuilderScope as TessellatedShapeBuilderScope; return(bs.TargetGeometry == TessellatedShapeBuilderTarget.Solid && bs.FallbackGeometry == TessellatedShapeBuilderFallback.Abort); } if (BuilderType == IFCShapeBuilderType.BrepBuilder) { // Currently for BrepBuilder, we hard code that BrepType is Solid, so this must return true return(true); } return(false); }
/// <summary> /// Initialize the builder that will be used to create the geometry /// </summary> /// <param name="builderType">The type of the builder</param> public BuilderScope InitializeBuilder(IFCShapeBuilderType builderType) { if (BuilderScope != null) { throw new InvalidOperationException("BuilderScope has already been initialized"); } BuilderType = builderType; BuildPreference = BuildPreference; if (builderType == IFCShapeBuilderType.TessellatedShapeBuilder) { BuilderScope = new TessellatedShapeBuilderScope(this); } return(BuilderScope); }
/// <summary> /// Initialize the builder that will be used to create the geometry /// </summary> /// <param name="builderType">The type of the builder</param> public BuilderScope InitializeBuilder(IFCShapeBuilderType builderType) { if (BuilderScope != null) { throw new InvalidOperationException("BuilderScope has already been initialized"); } BuilderType = builderType; BuildPreference = BuildPreference; if (builderType == IFCShapeBuilderType.TessellatedShapeBuilder) { BuilderScope = new TessellatedShapeBuilderScope(this); } return BuilderScope; }