diff --git a/Elements.MEP/src/Fittings/FittingRepresentationStorage.cs b/Elements.MEP/src/Fittings/FittingRepresentationStorage.cs index fa499f6c5..d25c2cd67 100644 --- a/Elements.MEP/src/Fittings/FittingRepresentationStorage.cs +++ b/Elements.MEP/src/Fittings/FittingRepresentationStorage.cs @@ -11,32 +11,17 @@ static class FittingRepresentationStorage private static readonly Dictionary> _fittings = new Dictionary>(); public static Dictionary> Fittings => _fittings; - public static void SetFittingRepresentation(Fitting fitting, Func> makeSolids, Boolean unioned = true, Boolean updateTransform = true) + public static void SetFittingRepresentation(Fitting fitting, Func> makeSolids) { var hash = fitting.GetRepresentationHash(); if (!_fittings.ContainsKey(hash)) { var solids = makeSolids(); - var representationInstances = new List(); - if (unioned) - { - representationInstances = new List { new RepresentationInstance(new SolidRepresentation(solids), fitting.Material) }; - } - else - { - foreach (var solid in solids) - { - representationInstances.Add(new RepresentationInstance(new SolidRepresentation(solid), fitting.Material)); - } - } - _fittings.Add(hash, representationInstances); + _fittings.Add(hash, new List { new RepresentationInstance(new SolidRepresentation(solids), fitting.Material) }); } fitting.RepresentationInstances = _fittings[hash]; - if (updateTransform) - { - fitting.Transform = fitting.GetRotatedTransform().Concatenated(new Transform(fitting.Transform.Origin)); - } + fitting.Transform = fitting.GetRotatedTransform().Concatenated(new Transform(fitting.Transform.Origin)); } } } \ No newline at end of file diff --git a/Elements.MEP/src/Fittings/Reducer.cs b/Elements.MEP/src/Fittings/Reducer.cs index e4aea1b81..e40749f29 100644 --- a/Elements.MEP/src/Fittings/Reducer.cs +++ b/Elements.MEP/src/Fittings/Reducer.cs @@ -76,7 +76,10 @@ public override void UpdateRepresentations() // 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 { sweep1, sweep2 }.Concat(arrows).ToList(); - FittingRepresentationStorage.SetFittingRepresentation(this, () => solidOperations, false, false); + foreach (var solidOperation in solidOperations) + { + this.RepresentationInstances.Add(new RepresentationInstance(new SolidRepresentation(solidOperation), this.Material)); + } } public override void ApplyAdditionalTransform()