public static TheatronGeometry TheatronGeometry(TheatronPlan planPart, TheatronFullProfile profile, List <ProfileParameters> pParams) { var theatron = CreateGeometry(planPart, profile, pParams, StadiaType.Undefined); theatron.Tiers3d.ForEach(t => t.Generatorblocks.ForEach(g => { t.TierBlocks.Add(g); theatron.Audience.Add(g.Audience); })); return(theatron); }
public static TheatronGeometry TheatronGeometry(TheatronPlan planPart, TheatronFullProfile profile, List <ProfileParameters> pParams) { if (planPart == null) { BH.Engine.Reflection.Compute.RecordError("Cannot create theatron geometry will a null theatron plan."); return(null); } if (profile == null) { BH.Engine.Reflection.Compute.RecordError("Cannot create theatron geometry will a null profile."); return(null); } if (pParams == null) { BH.Engine.Reflection.Compute.RecordError("Cannot create theatron geometry from a null collection of profile parameters."); return(null); } var theatron = CreateGeometry(planPart, profile, pParams, StadiaType.Undefined); theatron.Tiers3d.ForEach(t => t.Generatorblocks.ForEach(g => { t.TierBlocks.Add(g); theatron.Audience.Add(g.Audience); })); return(theatron); }
/***************************************************/ /**** Private Methods ****/ /***************************************************/ private static void GenerateMapProfiles(ref TheatronFullProfile fullProfile, List <ProfileParameters> parameters, double distToFocalCurve, ProfileOrigin sectionOrigin) { Point lastpoint = new Point(); for (int i = 0; i < parameters.Count; i++) { if (i == 0) { parameters[i].StartX = distToFocalCurve + parameters[i].RowWidth - parameters[i].EyePositionParameters.EyePositionX; } TierProfile tierSection = TierProfile(parameters[i], lastpoint); fullProfile.BaseTierProfiles.Add(tierSection); if (i == 0) { fullProfile.FullProfileOrigin = fullProfile.BaseTierProfiles[0].SectionOrigin; fullProfile.FullProfileOrigin.Origin.Z = 0; } Point source = fullProfile.FullProfileOrigin.Origin; Point target = sectionOrigin.Origin; double angle = Math.Atan2(sectionOrigin.Direction.Y, sectionOrigin.Direction.X); Vector scaleVector = SetScaleVector(tierSection.SectionOrigin.Direction, tierSection.SectionOrigin, tierSection.SectionOrigin); fullProfile.MappedProfiles.Add(TransformProfile(tierSection, scaleVector, source, target, angle)); lastpoint = tierSection.FloorPoints[tierSection.FloorPoints.Count - 1]; } }
public static TheatronGeometry TheatronGeometry(TheatronPlan planFull, TheatronFullProfile profile, StadiaParameters sParams, List <ProfileParameters> pParams) { if (planFull == null) { BH.Engine.Reflection.Compute.RecordError("Cannot create theatron geometry will a null theatron plan."); return(null); } if (profile == null) { BH.Engine.Reflection.Compute.RecordError("Cannot create theatron geometry will a null profile."); return(null); } if (sParams == null) { BH.Engine.Reflection.Compute.RecordError("Cannot create theatron geometry from a null set of stadia parameters."); return(null); } var theatron = CreateGeometry(planFull, profile, pParams, sParams.TypeOfBowl); CopyGeneratorBlocks(ref theatron, planFull, sParams.TypeOfBowl); return(theatron); }
public static TheatronFullProfile TheatronFullProfile(List <ProfileParameters> parameters, Point focalPoint, ProfileOrigin sectionOrigin) { if (parameters == null) { BH.Engine.Reflection.Compute.RecordError("Cannot create a theatron full profile from a null collection of profile parameters."); return(null); } if (focalPoint == null) { BH.Engine.Reflection.Compute.RecordError("Cannot create a theatron full profile from a null focal point."); return(null); } if (sectionOrigin == null) { BH.Engine.Reflection.Compute.RecordError("Cannot create a theatron full profile from a null profile origin."); return(null); } //this assumes no relation with the plan geometry setting out is from the origin TheatronFullProfile fullProfile = new TheatronFullProfile(); Point lastpoint = new Point(); //fullProfile.FocalPoint = focalPoint; Vector focalToStart = sectionOrigin.Origin - focalPoint; focalToStart.Z = 0; GenerateMapProfiles(ref fullProfile, parameters.DeepClone(), focalToStart.Length(), sectionOrigin); return(fullProfile); }
public static TheatronGeometry TheatronGeometry(TheatronPlan planFull, TheatronFullProfile profile, StadiaParameters sParams, List <ProfileParameters> pParams) { var theatron = CreateGeometry(planFull, profile, pParams, sParams.TypeOfBowl); CopyGeneratorBlocks(ref theatron, planFull, sParams.TypeOfBowl); return(theatron); }
public static TheatronFullProfile TheatronFullProfile(List <ProfileParameters> parameters, TheatronPlan planGeometry) { TheatronFullProfile fullProfile = new TheatronFullProfile(); GenerateMapProfiles(ref fullProfile, parameters.DeepClone(), planGeometry.MinDistToFocalCurve, planGeometry.SectionClosestToFocalCurve); return(fullProfile); }
/***************************************************/ /**** Private Methods ****/ /***************************************************/ private static TheatronGeometry CreateGeometry(TheatronPlan plan, TheatronFullProfile profile, List <ProfileParameters> pParams, StadiaType stadiaType) { var theatron = new TheatronGeometry(); theatron.TotalTiers = profile.MappedProfiles.Count; SetGeneratorblocks(ref theatron, profile, plan, stadiaType, pParams); SetFloorMeshes(ref theatron, pParams); SetGeneratorEyes(ref theatron); return(theatron); }
public static TheatronFullProfile TheatronFullProfile(List <ProfileParameters> parameters) { //this assumes no relation with the plan geometry setting out is from the origin TheatronFullProfile fullProfile = new TheatronFullProfile(); double minDist = parameters[0].StartX - parameters[0].EyePositionParameters.EyePositionX; Point origin = Geometry.Create.Point(minDist, 0, parameters[0].StartZ - parameters[0].EyePositionParameters.EyePositionZ); Vector direction = Vector.XAxis; ProfileOrigin sectionOrigin = ProfileOrigin(origin, direction); GenerateMapProfiles(ref fullProfile, parameters.DeepClone(), minDist, sectionOrigin); return(fullProfile); }
public static TheatronFullProfile TheatronFullProfile(List <ProfileParameters> parameters, Point focalPoint, ProfileOrigin sectionOrigin) { //this assumes no relation with the plan geometry setting out is from the origin TheatronFullProfile fullProfile = new TheatronFullProfile(); Point lastpoint = new Point(); //fullProfile.FocalPoint = focalPoint; Vector focalToStart = sectionOrigin.Origin - focalPoint; focalToStart.Z = 0; GenerateMapProfiles(ref fullProfile, parameters.DeepClone(), focalToStart.Length(), sectionOrigin); return(fullProfile); }
public static TheatronFullProfile TheatronFullProfile(List <ProfileParameters> parameters) { if (parameters == null) { BH.Engine.Reflection.Compute.RecordError("Cannot create a theatron full profile from a null collection of profile parameters."); return(null); } //this assumes no relation with the plan geometry setting out is from the origin TheatronFullProfile fullProfile = new TheatronFullProfile(); double minDist = parameters[0].StartX - parameters[0].EyePositionParameters.EyePositionX; Point origin = Geometry.Create.Point(minDist, 0, parameters[0].StartZ - parameters[0].EyePositionParameters.EyePositionZ); Vector direction = Vector.XAxis; ProfileOrigin sectionOrigin = ProfileOrigin(origin, direction); GenerateMapProfiles(ref fullProfile, parameters.DeepClone(), minDist, sectionOrigin); return(fullProfile); }
public static TheatronFullProfile TheatronFullProfile(List <ProfileParameters> parameters, TheatronPlan planGeometry) { if (parameters == null) { BH.Engine.Reflection.Compute.RecordError("Cannot create a theatron full profile from a null collection of profile parameters."); return(null); } if (planGeometry == null) { BH.Engine.Reflection.Compute.RecordError("Cannot create a theatron full profile from a null theatron plan."); return(null); } TheatronFullProfile fullProfile = new TheatronFullProfile(); GenerateMapProfiles(ref fullProfile, parameters.DeepClone(), planGeometry.MinDistToFocalCurve, planGeometry.SectionClosestToFocalCurve); return(fullProfile); }
public TheatronGeometry TestPartialBowl(TheatronFullProfile profile, List <ProfileParameters> pParams) { //testing a theatre type configuration based on a straight line Point start = Create.Point(0, 0, 0); Point end = Create.Point(0, 20, 0); Polyline focalline = Create.Polyline(new List <Point> { start, end }); Vector direction = Create.Vector(1, 0, 0); List <ProfileOrigin> structuralOrigins = new List <ProfileOrigin>(); for (int i = 0; i < 5; i++) { Point origin = Create.Point(-6, 5 * i, 0); structuralOrigins.Add(BH.Engine.Architecture.Theatron.Create.ProfileOrigin(origin, direction)); } var plan = BH.Engine.Architecture.Theatron.Create.PlanGeometry(structuralOrigins, focalline); var bowlPart = BH.Engine.Architecture.Theatron.Create.TheatronGeometry(plan, profile, pParams); return(bowlPart); }
/***************************************************/ private static void SetGeneratorblocks(ref TheatronGeometry theatronGeom, TheatronFullProfile fullprofile, TheatronPlan theatronPlan, StadiaType stadiatype, List <ProfileParameters> profileParameters) { //this defines the geometry of the seating blocks from which all others are created TierProfile tierToMap; for (int i = 0; i < theatronGeom.TotalTiers; i++) { tierToMap = fullprofile.BaseTierProfiles[i]; theatronGeom.Tiers3d.Add(new Tier()); var SectionBlock = GetBlockStartIndexes(theatronPlan, stadiatype); foreach (var pair in SectionBlock) { int index = pair.Key; SeatingBlockType blockType = pair.Value; var block = SeatingBlock(theatronPlan.SectionOrigins[index], theatronPlan.VomitoryOrigins[index], theatronPlan.SectionOrigins[index + 1], blockType, profileParameters[i].SeatWidth, profileParameters[i].VomitoryParameters.VomitoryWidth); theatronGeom.Tiers3d[i].Generatorblocks.Add(block); if (block.TypeOfSeatingBlock == SeatingBlockType.Transition1 || block.TypeOfSeatingBlock == SeatingBlockType.Transition2) { //cannot use vomitory location to define profile scaling SetTransitionProfiles(ref block, tierToMap, fullprofile.FullProfileOrigin, theatronPlan.VomitoryOrigins[index - 1], theatronPlan.VomitoryOrigins[index + 1]); } else { SetBlockProfiles(ref block, tierToMap, fullprofile.FullProfileOrigin); } } if (stadiatype == StadiaType.EightArc || stadiatype == StadiaType.Orthogonal) { SetOtherBlockTypes(ref theatronGeom, i, fullprofile);//only needed for radial and othogonal } } }
/***************************************************/ private static void SetOtherBlockTypes(ref TheatronGeometry theatronGeom, int tierNum, TheatronFullProfile fullprofile) { ////no Vomitory corner block var corner = theatronGeom.Tiers3d[tierNum].Generatorblocks.Find(x => x.TypeOfSeatingBlock == SeatingBlockType.Corner); var cornerNoVom = corner.DeepClone(); cornerNoVom.TypeOfSeatingBlock = SeatingBlockType.CornerNoVom; theatronGeom.Tiers3d[tierNum].Generatorblocks.Add(cornerNoVom); //// transition 1 block var toMirror = theatronGeom.Tiers3d[tierNum].Generatorblocks.Find(x => x.TypeOfSeatingBlock == SeatingBlockType.Transition1); var transMirror1 = Create.MirrorSeatingBlock(toMirror, SeatingBlockType.Transition1mirrored); theatronGeom.Tiers3d[tierNum].Generatorblocks.Add(transMirror1); //// transition 2 block toMirror = theatronGeom.Tiers3d[tierNum].Generatorblocks.Find(x => x.TypeOfSeatingBlock == SeatingBlockType.Transition2); var transMirror2 = Create.MirrorSeatingBlock(toMirror, SeatingBlockType.Transition2mirrored); theatronGeom.Tiers3d[tierNum].Generatorblocks.Add(transMirror2); }
public TheatronGeometry TestPartialBowl(TheatronPlan plan, TheatronFullProfile profile, List <ProfileParameters> pParams) { //profileorigins are taken from a full bowl layout here return(BH.Engine.Architecture.Theatron.Create.TheatronGeometry(plan.SectionOrigins.GetRange(0, 10), profile, pParams)); }
public static TheatronGeometry TheatronGeometry(List <ProfileOrigin> structuralOrigins, TheatronFullProfile profile, List <ProfileParameters> pParams) { var plan = PlanGeometry(structuralOrigins, null); var theatron = CreateGeometry(plan, profile, pParams, StadiaType.Undefined); theatron.Tiers3d.ForEach(t => t.Generatorblocks.ForEach(g => { t.TierBlocks.Add(g); theatron.Audience.Add(g.Audience); })); return(theatron); }