Click or drag to resize

BoundaryRepresentationGeometry Class

[This is preliminary documentation and is subject to change.]

Defines the geometry for a boundary representation (= BREP)
Inheritance Hierarchy
SystemObject
  ModelExchanger.AnalysisDataModel.SubtypesBoundaryRepresentationGeometry

Namespace:  ModelExchanger.AnalysisDataModel.Subtypes
Assembly:  ModelExchanger.AnalysisDataModel (in ModelExchanger.AnalysisDataModel.dll) Version: 1.13.0+Branch.master.Sha.d583fc64569355d188a9c0818d257b6d0d3e1339
Syntax
C#
public sealed class BoundaryRepresentationGeometry : IEquatable<BoundaryRepresentationGeometry>

The BoundaryRepresentationGeometry type exposes the following members.

Constructors
  NameDescription
Public methodBoundaryRepresentationGeometry
Create a new BREP geometry definition by providing the vertices & faces that define the BREP
Top
Properties
  NameDescription
Public propertyFaces
The faces of the geometry. Each face contains a list of indexes, which refer to one of the vertices defined in Vertices
Public propertyVertices
The vertices that define the geometry.
Top
Methods
  NameDescription
Public methodEquals(BoundaryRepresentationGeometry)
Compare this instance against another instance for equality
Public methodEquals(Object)
Compare this instance against another object
(Overrides ObjectEquals(Object).)
Public methodGetHashCode
Serves as the default hash function.
(Overrides ObjectGetHashCode.)
Top
Examples
Creating an instance
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using ModelExchanger.AnalysisDataModel.Libraries;
using ModelExchanger.AnalysisDataModel.Models;
using ModelExchanger.AnalysisDataModel.StructuralElements;
using ModelExchanger.AnalysisDataModel.Subtypes;
using UnitsNet;

namespace ModelExchanger.AnalysisDataModel.Example.StructuralElements
{
    public sealed class StructuralProxyElementExample : BaseExample<StructuralProxyElement>
    {
        protected override IReadOnlyCollection<StructuralProxyElement> CreateAnalysisObjects(AnalysisModel model)
        {
            IReadOnlyDictionary<string, StructuralMaterial> materials = model.OfType<StructuralMaterial>().ToDictionary(x => x.Name, x => x);

            return new[]
            {
                new StructuralProxyElement(Guid.NewGuid(), "GS1", materials["MAT1"], CreateGeometry())
                {
                    Color = (uint)Color.LightGray.ToArgb()
                }
            };
        }

        private BoundaryRepresentationGeometry CreateGeometry()
        {
            return new BoundaryRepresentationGeometry(CreateCoordinates(), CreateFaces());
        }

        #region Coordinates

        private IReadOnlyList<Coordinate> CreateCoordinates() => new[]
        {
            new Coordinate("C1", Length.FromMeters(-8), Length.FromMeters(0), Length.FromMeters(-4)),
            new Coordinate("C2", Length.FromMeters(-4), Length.FromMeters(0), Length.FromMeters(-4)),
            new Coordinate("C3", Length.FromMeters(-4), Length.FromMeters(0), Length.FromMeters(0)),
            new Coordinate("C4", Length.FromMeters(-8), Length.FromMeters(0), Length.FromMeters(0)),
            new Coordinate("C5", Length.FromMeters(-8), Length.FromMeters(4), Length.FromMeters(-4)),
            new Coordinate("C6", Length.FromMeters(-4), Length.FromMeters(4), Length.FromMeters(-4)),
            new Coordinate("C7", Length.FromMeters(-4), Length.FromMeters(4), Length.FromMeters(0)),
            new Coordinate("C8", Length.FromMeters(-8), Length.FromMeters(4), Length.FromMeters(0)),

            new Coordinate("C9", Length.FromMeters(-7), Length.FromMeters(1), Length.FromMeters(-4)),
            new Coordinate("C10", Length.FromMeters(-5), Length.FromMeters(1), Length.FromMeters(-4)),
            new Coordinate("C11", Length.FromMeters(-5), Length.FromMeters(3), Length.FromMeters(-4)),
            new Coordinate("C12", Length.FromMeters(-7), Length.FromMeters(3), Length.FromMeters(-4)),
            new Coordinate("C13", Length.FromMeters(-7), Length.FromMeters(1), Length.FromMeters(0)),
            new Coordinate("C14", Length.FromMeters(-5), Length.FromMeters(1), Length.FromMeters(0)),
            new Coordinate("C15", Length.FromMeters(-5), Length.FromMeters(3), Length.FromMeters(0)),
            new Coordinate("C16", Length.FromMeters(-7), Length.FromMeters(3), Length.FromMeters(0)),
        };

        #endregion

        #region Faces

        private IReadOnlyList<Face> CreateFaces() => new[]
        {
            new Face(new []{ 0,1,2,3}), // Front
            new Face(new []{ 1,5,6,2}), // Right
            new Face(new []{ 5,4,7,6}), // Back
            new Face(new []{ 4,0,3,7}), // Left
            new Face(new [] // Bottom
            {
                new []{ 4,5,1,0 },
                new []{11,8,9,10} // Opening
            }),
            new Face(new [] // Top
            {
                new []{ 3,2,6,7},
                new [] {12,15,14,13} // Opening
            }),
            new Face(new []{8,9,13,12}), // Inner front
            new Face(new []{ 9,10,14,13}), // Inner right
            new Face(new [] { 10,11,15,14}), // Inner back
            new Face(new []{ 11,8,12,15}), // Inner left
        };

        #endregion

    }
}
See Also