Skip to content

Commit

Permalink
🆙 : concelead bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco-Pellegrino committed Oct 31, 2023
1 parent a03e5b8 commit 3e33501
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
12 changes: 4 additions & 8 deletions FemDesign.Core/Reinforcement/ConcealedBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,10 @@ public ConcealedBar(Shells.Slab slab, RectangleType rectangle, bool axisInLonger
this.EntityCreated();
this.BaseShell = slab.SlabPart.Guid;
this.AxisInLongerSide = axisInLongerSide;
//if(axisInLongerSide)
//{
// this.Start = rectangle.BaseCorner + new Vector3d(0, rectangle.DimY / 2, 0);
//}
//else
//{
// this.Start = rectangle.BaseCorner + new Vector3d(rectangle.DimX / 2, 0, 0);
//}
if (axisInLongerSide == false)
{
this.Start = rectangle.BaseCorner + rectangle.LocalX * (rectangle.DimX / 2);
}
this.Rectangle = rectangle;
this.Identifier = identifier;
}
Expand Down
10 changes: 3 additions & 7 deletions FemDesign.Grasshopper/Reinforcement/ConcealedBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ protected override void SolveInstance(IGH_DataAccess DA)
if (!DA.GetData("RefConcreteSlab", ref slab)) return;

bool axisLongerDirection = true;
DA.GetData("AxisLongerSide", ref axisLongerDirection);
DA.GetData("Axis", ref axisLongerDirection);

string identifier = "CB";
DA.GetData("Identifier", ref identifier);

var _rectangle = rectangle.FromRhino();

// error handling in Grasshopper
// check if corners are in the slab
for(int i = 0; i < 4; i++)
{
var pt = rectangle.Corner(i);
Expand All @@ -57,12 +59,6 @@ protected override void SolveInstance(IGH_DataAccess DA)

var obj = new FemDesign.Reinforcement.ConcealedBar(slab, _rectangle, axisLongerDirection, identifier);

if(axisLongerDirection == false)
{
var start = rectangle.PointAt(0.5, 0);
obj.Start = start.FromRhino();
}

DA.SetData(0, obj);
}
protected override System.Drawing.Bitmap Icon => FemDesign.Properties.Resources.ConcealedBar;
Expand Down

0 comments on commit 3e33501

Please sign in to comment.