Skip to content

Commit

Permalink
Fix method in FishMarket length
Browse files Browse the repository at this point in the history
  • Loading branch information
hrntsm committed Jun 3, 2022
1 parent 3e895a7 commit 585d5ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Tunny/Component/FishMarket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ private GH_Structure<IGH_GeometricGoo> ArrayedGeometries(List<object> fishObject
var arrayedGeometries = new GH_Structure<IGH_GeometricGoo>();
_fishes = fishObjects.Select(x => (GH_Fish)x).ToList();
var fishGeometries = _fishes.Select(x => x.Value.Geometries).ToList();

while (true)
{
remainGeometry = NewMethod(countY, remainGeometry, arrayedGeometries, fishGeometries);
remainGeometry = SetGeometryToResultArray(countY, remainGeometry, arrayedGeometries, fishGeometries);
if (!remainGeometry)
{
break;
Expand All @@ -102,7 +103,7 @@ private GH_Structure<IGH_GeometricGoo> ArrayedGeometries(List<object> fishObject
return arrayedGeometries;
}

private bool NewMethod(int countY, bool remainGeometry, GH_Structure<IGH_GeometricGoo> arrayedGeometries, List<List<GeometryBase>> fishGeometries)
private bool SetGeometryToResultArray(int countY, bool remainGeometry, GH_Structure<IGH_GeometricGoo> arrayedGeometries, List<List<GeometryBase>> fishGeometries)
{
Vector3d yVec = _settings.Plane.YAxis * (_settings.YInterval * countY);
for (int countX = 0; countX < _settings.XNum; countX++)
Expand All @@ -121,8 +122,7 @@ private bool NewMethod(int countY, bool remainGeometry, GH_Structure<IGH_Geometr
{
geometry.Rotate(Vector3d.VectorAngle(Vector3d.XAxis, _settings.Plane.XAxis), Vector3d.ZAxis, modelMinPt);
geometry.Translate(xVec + yVec + new Vector3d(_settings.Plane.Origin) - new Vector3d(modelMinPt));
IGH_GeometricGoo geometricGoo = CreateGeometricGoo(geometry);
arrayedGeometries.Append(geometricGoo, new GH_Path(0, _fishes[index].Value.ModelNumber));
arrayedGeometries.Append(CreateGeometricGoo(geometry), new GH_Path(0, _fishes[index].Value.ModelNumber));
}
_tagPlanes.Add(new Plane(modelMinPt - _settings.Plane.YAxis * 2.5 * _size, _settings.Plane.XAxis, _settings.Plane.YAxis));
}
Expand Down

0 comments on commit 585d5ea

Please sign in to comment.