Skip to content

Commit

Permalink
#3029 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelbaran authored and Fraser Greenroyd committed Mar 28, 2023
1 parent e401ff9 commit d2fe026
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Structure_Engine/Modify/Transform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ public static Node Transform(this Node node, TransformMatrix transform, double t
[Output("transformed", "Modified Bar with unchanged properties, but transformed nodes and orientation.")]
public static Bar Transform(this Bar bar, TransformMatrix transform, double tolerance = Tolerance.Distance)
{
if (bar.StartNode?.Position == null || bar.EndNode?.Position == null)
{
BH.Engine.Base.Compute.RecordWarning("The bar could not be transformed because at least one of its nodes (or their location) is null.");
return bar;
}

if (!transform.IsRigidTransformation(tolerance))
{
BH.Engine.Base.Compute.RecordError("Transformation failed: only rigid body transformations are currently supported.");
Expand Down

0 comments on commit d2fe026

Please sign in to comment.