Hypar.Elements.Serialization.IFC
- IFC serialization code has been moved to a new project.Hypar.Elements.CodeGeneration
- Code generation has been moved to a new project.Elements.DirectionalLight
- You can now create a directional light in the model which will be written to glTF using theKHR_lights_punctual
extension.Elements.ContentElement
- This new class represents a piece of content meant to be instanced throughout a model.- The ContentElement is also added to the model by first checking for an available gltf, and then using a bounding box representation as a fallback.
Transform.Scaled()
- This new method returns a scaled copy of the transform, allowing for a fluent like api.Transform.Moved(...)
- Return a copy of a transform moved by the specified amount.Transform.Concatenated(...)
- Return a copy of a transform with the specified transform concatenated with it.IHasOpenings.AddOpening(...)
-AddOpening
provides an API which hides the internals of creating openings.Opening.DepthFront
&Opening.DepthBack
enable the creation of openings which extrude different amounts above and below their XY plane.- Solid operations which have
IsVoid=true
now use csg operations.
- Updated ImageSharp to 1.0.0.
- The source code is now structured with the typical .NET project layout of
/src
and/test
per folder. Opening
now has two primary constructors. The ability to create an opening with a profile has been removed. All profiles are now defined with a polygon as the perimeter.Opening.Profile
is now deprecated. Please useOpening.Perimeter
.Polygon.Normal()
has been moved to the base classPolyline.Normal()
.
- Fixed #313.
- Fixed #322.
- Fixed #342.
- Fixed #392.
- Fixed #407.
- Fixed #408
- Fixed #416.
- Fixed #417.
- Fixed #441
- CodeGen was failing intermittently
- Elements schemas with Dictionary types were failing to serialize
- #355
- Elements supports the Hub beta
- CodeGen supports
input_schema
- Hypar.Revit is completely rewritten as an external application, two external commands, and an IDirectContext3D server.
- some Tessellate method signatures are updated to allow assigning colors at the time of tessellation as Revit requires vertex colors.
- Updates are made to the type generator to support compiling multiple types into an assembly on disk.
- #307
Mesh.ComputeNormals()
would fail if there were any unconnected vertices.new Vertex()
would ignore supplied Normals.Vector3.ClosestPointOn(Line)
would return points that were not on the line.Line.Intersects(Line)
in infinite mode would sometimes return erroneous results.Vector3.AreCollinear()
would return the wrong result if the first two vertices were coincident.
- Added
Plane.ClosestPoint(Vector3 p)
- New methods for dynamic type generation in
TypeGeneration
, utilized by the Grasshopper plugin. Line.Trim(Polygon)
Line.PointOnLine(Vector3 point)
- Grid1d
Grid1d(Grid1d other)
constructor- Adds
IgnoreOutsideDomain
flag toSplitAtOffset
- Adds
SplitAtPoint(point)
andSplitAtPoints(points)
methods - Adds internal
Evaluate(t)
method - Adds internal
SpawnSubGrid(domain)
method
- Grid2d
- Adds
Grid2d(Grid2d other)
constructor - Adds
Grid2d(Grid2d other, Grid1d u, Grid1d v)
constructor - Adds
SplitAtPoint(point)
andSplitAtPoints(points)
methods to Grid2d - Adds
Grid2d(Grid1d u, Grid1d v)
constructor - Adds support for curved 1d Grid axes
- Adds private
SpawnSubGrid(Grid1d uCell, Grid1d vCell)
method
- Adds
Curve.Transformed(transform)
(and relatedXXX.TransformedXXX()
methods for child types Arc, Bezier, Line, Polyline, Polygon)
- Updates to Elements Docs including Grasshopper + Excel.
Line.Intersects(Plane p)
supports infinite linesLine.Intersects(Line l)
supports 3d line intersectionsLine.Intersects(Line l)
now has an optional flag indicating whether to include the line ends as intersections.Line.PointOnLine(Point)
now has an optional flag indicating whether to include points at the ends as "on" the line.- Grid1d / Grid2d
- Removes "Parent/child" updating from 1d grids / 2d grids in favor of always recalculating the 2d grid every time its
Cells
are accessed. This may have a bit of a performance hit, but it's worth it to make 2d grid behavior easier to reason about. - Allows Grid2ds to support construction from Grid1ds that are not straight lines. Previously Grid1ds could support any sort of curve and Grid2ds were stuck as dumb rectangles.
- Removes "Parent/child" updating from 1d grids / 2d grids in favor of always recalculating the 2d grid every time its
- JsonInheritanceConverter
- Makes the Type Cache on the JsonInheritanceConverter static, and exposes a public method to refresh it. In the grasshopper context, new types may have been dynamically loaded since the JsonInheritanceConverter was initialized, so it needs to be refreshed before deserializing a model.
- TypeGenerator
- Enables external overriding of the Templates path, as in GH's case the
Templates
folder is not in the same place as the executing assembly. - Exposes a public, synchronous method
GetSchema
to get aJsonSchema
from uri (wrappingGetSchemaAsync
) - Refactors some of the internal processes of
GenerateInMemoryAssemblyFromUrisAndLoadAsync
:GenerateCodeFromSchema()
produces csharp from a schema, including generating the namespace, typename, and local excludesGenerateCompilation()
takes the csharp and compiles it, using a new optional flagframeworkBuild
to designate whether it should load netstandard or net framework reference assemblies.EmitAndLoad()
generates the assembly in memory and loads it into the app domain.
- Adds an
EmitAndSave()
method that generates the assembly and writes it to a .dll on disk - Adds a public
GenerateAndSaveDllForSchema()
method used by grasshopper that generates code from a schema, generates a compilation, and saves it to disk as a DLL. - Adds a public
GetLoadedElementTypes()
method used by grasshopper to list all the currently loaded element types.
- Enables external overriding of the Templates path, as in GH's case the
Transform.OfXXX(xxx)
curve methods have been deprecated in favor ofXXX.Transformed(Transform)
andXXX.TransformedXXX(Transform)
.
Curve.ToPolyline(int divisions = 10)
Circle.ToPolygon(int divisions = 10)
Transform.Move(double x, double y, double z)
Transform.Rotate(double angle)
TypeGenerator.GenerateUserElementTypesFromUrisAsync(string[] uris, string outputBaseDir, bool isUserElement = false)
- Updated documentation to reflect the use of .NET Core 3.1.
Polygon.Circle(...)
Material.Unlit
Material.DoubleSided
Units.LengthUnit
Elements.MeshImportElement
Mesh.AddVertex(...)
is now public.Mesh.AddTriangle(...)
is now public.
SolidOperation.GetSolid()
.
- #262
- Fixed an error where
Transform.OfPlane(...)
would not solve correctly if the plane was not at the world origin.
Grid2d
now supports grids that are not parallel to the XY plane
ColorScale
AnalysisMesh
Ray.Intersects(...)
forPlane
,Face
,Solid
, andSolidOperation
- Fix #253
Grid2d
constructors accepting a Transform interpreted the transform incorrectly.
Grid1d
Grid2d
Domain1d
GeometricElement.IsElementDefinition
- A
drawEdges
optional parameter toModel.ToGlTF(...)
to enable edge rendering. Polyline
andProfile
now implementIEquatable
.Polygon.Union(IList<Polygon> firstSet, IList<Polygon> secondSet)
Polygon.Difference(IList<Polygon> firstSet, IList<Polygon> secondSet)
Polygon.XOR(IList<Polygon> firstSet, IList<Polygon> secondSet)
Polygon.Intersection(IList<Polygon> firstSet, IList<Polygon> secondSet)
Vector.Normalized()
is nowVector.Unitized()
Color.ToString()
now returns a useful description
- Fixed an error with
Transform.OfVector(...)
where the translation of the transform was not applied. - Fixed an error where
Mesh.ComputeNormals(...)
was not set to a unitized vector. - Fixed an error with
BBox3
's solver for Polygons
Contour
Transform.Reflect(Vector3 n)
ElementInstance
Vector3.ClosestPointOn(Line line)
Line.TrimTo(Line line)
Line.ExtendTo(Line line)
Line.Offset(double distance, bool flip = false)
Line.DivideByLengthFromCenter(double l)
Ray.Intersects(Ray ray, out Vector3 result, bool ignoreRayDirection)
Polygon.Fillet(double radius)
Arc.Complement()
Polygons.Star(double outerRadius, double innerRadius, int points)
Units.CardinalDirections
Mesh.ComputeNormals
Topography.AverageEdges(Topography target, Units.CardinalDirection edgeToAverage)
Topography.GetEdgeVertices(Units.CardinalDirection direction)
WebMercatorProjection
- Fixed #125.
- Fixed one Transform constructor whose computed axes were not unit length, causing the transform to scale.
- Topography is now written to IFC.
Vector3
is now a struct.Color
is now a struct.ProfileServer.GetProfileByName(...)
is now deprecated in favor ofProfileServer.GetProfileByType(...)
Bezier
WideFlangeProfileType
HSSPipeProfileType
Curve.MinimumChordLength
static property to allow the user to set the minimum chord length for subdivision of all curves for rendering.Circle
FrameType
Bezier curves can have their frames calculated using Frenet frames or "road like" frames.
- All element types are partial classes with one part of the class generated from its JSON schema.
Polygon.Rectangle
constructor no longer takes an origin.Polygon.Clip
now takes an optional additional set of holes.Wall
andFloor
constructors no longer take collections ofOpening
s.- Openings can be added using
wall.Openings.Add(...)
.
- Openings can be added using
Polygon
now has more robust checks during construction.- All vertices must be coplanar.
- Zero length segments are not allowed.
- Self-intersecting segments are not allowed.
Solid
,Face
,Vertex
,Edge
,HalfEdge
, andLoop
are now markedinternal
.Quaternion
is now markedinternal
.Matrix
is now markedinternal
.SolidConverter
is now markedinternal
.Elements.Serialization.IFC.ModelExtensions
is now markedinternal
.- All core type property setters are now
public
. - The
elevation
parameter has been removed fromFloor
. Floor elevation is now set by passing aTransform
with a Z coordinate.
ModelCurve
- Draw curves in 3D.ModelPoints
- Draw collections of points in 3D.Elements.Generate.TypeGenerator
class./Schemas
directory.- Optional
rotation
onStructuralFraming
constructors. Model
now has Elements property which isIDictionary<Guid,Element>
.double Vector3.CCW(Vector3 a, Vector3 b, Vector3 c)
bool Line.Intersects(Line l)
Elements.Validators.IValidator
and theElements.Validators.Validator
singleton to provide argument validation during construction of user elements.Line.DivideByLength()
Line.DivideByCount()
Ray
class.Vector3.IsZero()
- The empty Dynamo project.
ElementType
,WallType
,FloorType
,StructuralFramingType
MaterialLayer
Transform
constructor takingstart
andend
parameters. TheTransform
constructor which takes an X and a Z axis should now be used.
- Transforms are now consistently right-handed.
- Transforms on curves are now consistently oriented with the +X axis oriented to the "right" and the +Z axis oriented along the inverse of the tangent of the curve.
- Built in materials for displaying transforms are now red, green, and blue. Previously they were all red.
- All classes deriving from
Element
now pass theirid
,transform
, andname
to the base constructor. - Line/plane intersections now return null if the intersection is "behind" the start of the line.
- Beams whose setbacks total more than the length of the beam no longer fail.
- Plane construction no longer fails when the normal vector and the origin vector are "parallel".
- Fixed #209.
- Topography is now serialized to JSON.
- Built in materials now have an assigned Id.
- Elements representing building components now return positive areas.
- Added Area property to: Panel Space Added Volume property to:
- Floor
- Space Added positive area calculation to:
- Floor
- Mass
- Added positive Volume calculation to:
- StructuralFraming
- Beam.Volume() throws an InvalidOperationException for non-linear beams.
- Added TODO to support Volume() for all beam curves.
- Edges are no longer written to the glTF file.
- Large performance improvements made to glTF writing using
Buffer.BlockCopy
and writing buffers directly from tesselation to glTF buffer.
- Fix #177.
- Numerous comments were updated for clarity.
- Numerous styling changes were made to the documentation to align with the Hypar brand.
- Fixed an error where vertex colors were not correctly encoded in the glTF.
- Fix #173.
- Fix #7.
Element.Id
is now aGuid
.
- Fix #107.
- Fix #132.
- Fix #137.
- Fix #144.
- Fix #142.
- The
Kernel
singleton has been added to contain all geometry methods for creating solids.
- Fixed an error where, when writing edges to gltf, ushort would be overflowed and wrap back to 0 causing a loop not to terminate.
- Materials are now serialized to IFC using
IfcStyledItem
.
- Fixed an error where we returned directly after processing child Elements of an
IAggregateElements
, before we could process the parent element. - Fixed writing of gltf files so that the
.bin
file is located adjacent to the.gltf
.
Space
elements are now serialized to IFC asIfcSpace
.
IHasOpenings.Openings[]
is nowIHasOpenings.List<Opening>[]
.
Opening
elements are now serialized to IFC asIfcOpeningElement
.
Solid.Slice()
has been made internal. It's not yet ready for consumers. See #103
- Spaces are now correctly colored. See #134.
- Added
ToIfcWall()
extension method to save aWall
to anIfcWall
.
Space.Profile
is set in the constructor when aSpace
is constructed with a profile. #132- Sub-elements of
IAggregateElements
are now added to theModel
. #137
- Added
StandardWall
, for walls defined along a curve.Wall
continues to be for walls defined by a planar profile extruded to a height. - Added
Polygon.L
.
Floor
constructors no longer havematerial
parameter. Materials are now specified through theFloorType
.IAggregateElement
is nowIAggregateElements
.Panel
now takesPolygon
instead ofVector3[]
.
IGeometry3D
is nowISolid
.ISolid
(formerlyIGeometry3D
) now contains one solid, not an array of solids.
Solid.Material
. Elements are now expected to implement theIMaterial
interface or have anIElementType<T>
which specifies a material.
MaterialLayer
StructuralFramingType
-StructuralFramingType
combines aProfile
and aMaterial
to define a type for framing elements.
IProfileProvider
is nowIProfile
IElementTypeProvider
is nowIElementType
- All structural framing type constructors now take a
StructuralFramingType
in place of aProfile
and aMaterial
. - All properties serialize to JSON using camel case.
- Many expensive properties were converted to methods.
- A constructor has been added to
WallType
that takes a collection ofMaterialLayer
.
Matrix.Determinant()
Matrix.Inverse()
Transform.Invert()
Model.ToIFC()
Elements.Serialization.JSON
namespace.Elements.Serialization.IFC
namespace.Elements.Serialization.glTF
namespace.
- Wall constructor which uses a center line can now have a Transform specified.
Profile.ComputeTransform()
now finds the first 3 non-collinear points for calculating its plane. Previously, this function would break when two of the first three vertices were co-linear.- Using Hypar.IFC2X3 for interaction with IFC.
Line.Thicken()
now throws an exception when the line does not have the same elevation for both end points.Model.SaveGlb()
is nowModel.ToGlTF()
.
- The
Topography
class has been added. Transform.OfPoint(Vector3 vector)
has been added to transform a vector as a point with translation. This was previouslyTransform.OfVector(Vector3 vector)
. All sites previously usingOfVector(...)
are now usingOfPoint(...)
.Material.DoubleSided
Loop.InsertEdgeAfter()
Solid.Slice()
Model.Extensions
Transform.OfVector(Vector3 vector)
now does proper vector transformation without translation.- Attempting to construct a
Vector3
with NaN or Infinite arguments will throw anArgumentOutOfRangeException
.
- IFC implementation has begun with
Model.FromIFC(...)
. Support includes reading of Walls, Slabs, Spaces, Beams, and Columns. Brep booleans required for Wall and Slab openings are not yet supported and are instead converted to Polygon openings in Wall and Floor profiles. - The
Elements.Geometry.Profiles
namespace has been added. All profile servers can now be found here. - The
Elements.Geometry.Solids
namespace has been added. - The Frame type has been added to represent a continuous extrusion of a profile around a polygonal perimeter.
- The
ModelTest
base class has been added. Inheriting from this test class enables a test to automatically write itsModel
to a.glb
file and to serialize and deserialize to/from JSON to ensure the stability of serialization. - The
Solid.ToGlb
extension method has been added to enable serializing oneSolid
to glTF for testing.
- Element identifiers are now of type
long
. - Breps have been re-implemented in the
Solid
class. Currently only planar trimmed faces are supported. - Many improvements to JSON serialization have been added, including the ability to serialize breps.
- '{element}.AddParameter' has been renamed to '{element}.AddProperty'.
- The
Hypar.Geometry
namespace is nowElements.Geometry
. - The
Hypar.Elements
namespace is nowElements
.
- The
IProfile
interface has been removed. - The
Extrusion
class andIBrep
have been replaced with theSolid
class. The IGeometry interface now returns aSolid[]
. - Many uses of
System.Linq
have been removed. - Many uses of
IEnumerable<T>
have been replaced withT[]
.