Skip to content

Commit

Permalink
Merge pull request #1089 from hypar-io/use-representation-instances-f…
Browse files Browse the repository at this point in the history
…or-Reducer

Use representation instances for reducers
  • Loading branch information
jamesbradleym authored Jan 6, 2025
2 parents 2a88a1d + 8355394 commit 114dbb4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Elements.MEP/src/Fittings/Reducer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,14 @@ public override void UpdateRepresentations()
var arrows = this.Start.GetArrow(branchSideTransformInverted.OfPoint(startNodeTransform.Origin))
.Concat(this.End.GetArrow(endNodeTransform.Origin)).Concat(GetExtensions());

this.Representation = new Representation(new List<SolidOperation> { sweep1, sweep2 }.Concat(arrows).ToList());
// TODO: Update the Factory pattern for setting representationInstances to work with Reducer transforms.
// It would also be ideal to fully understand the geometry artifacts seen with certain Reducers that result in
// bad boolean graphics which result in invisible or fractured geometry.
var solidOperations = new List<SolidOperation> { sweep1, sweep2 }.Concat(arrows).ToList();
foreach (var solidOperation in solidOperations)
{
this.RepresentationInstances.Add(new RepresentationInstance(new SolidRepresentation(solidOperation), this.Material));
}
}

public override void ApplyAdditionalTransform()
Expand Down

0 comments on commit 114dbb4

Please sign in to comment.