Skip to content

Commit

Permalink
Merge pull request #225 from hrntsm/develop
Browse files Browse the repository at this point in the history
release v2.2.0
  • Loading branch information
hrntsm committed Mar 21, 2022
2 parents bd8e3fe + 1d98b1b commit 4c12dd2
Show file tree
Hide file tree
Showing 10 changed files with 3,304 additions and 19,524 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/check-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- name: Restore Tool
run: dotnet tool restore
- name: Lint
Expand Down
23 changes: 21 additions & 2 deletions .github/workflows/test-build-document.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- "website/**"

jobs:
deploy:
test-build:
runs-on: ubuntu-18.04
defaults:
run:
Expand All @@ -16,4 +16,23 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: yarn install
- run: yarn build
- run: yarn build

check-version:
runs-on: ubuntu-latest

steps:
- name: Create comments
run: |
echo "アップデートに向けて以下更新したか?" >> comments
echo "- package.json のバージョン" >> comments
sed -i -z 's/\n/\\n/g' comments
- name: Post multi-line comments
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
URL: ${{ github.event.pull_request.comments_url }}
run: |
curl -X POST \
-H "Authorization: token ${GITHUB_TOKEN}" \
-d "{\"body\": \"$(cat comments)\"}" \
${URL}
2 changes: 1 addition & 1 deletion HoaryFox/RH7/Component/Geometry/Stb2Brep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private void CreateBrep()
_brepList[3] = brepFromStb.Beam(member.StbBeams);
_brepList[4] = brepFromStb.Brace(member.StbBraces);
_brepList[5] = brepFromStb.Slab(member.StbSlabs);
_brepList[6] = brepFromStb.Wall(member.StbWalls);
_brepList[6] = brepFromStb.Wall(member.StbWalls, member.StbOpens);
}

private void BakeBrep()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,7 @@ private GH_Brep CreateSlabBrep(double depth, IList<PolylineCurve> curveList, IEn
{
return NonPlanarBrep(depth, curveList);
}

if (capedBrep.SolidOrientation == BrepSolidOrientation.Inward)
{
capedBrep.Flip();
}
capedBrep.Faces.SplitKinkyFaces();
CheckBrepOrientation(capedBrep);

return new GH_Brep(capedBrep);
}
Expand Down Expand Up @@ -312,7 +307,7 @@ private GH_Brep NonPlanarBrep(double depth, IList<PolylineCurve> curveList)
return new GH_Brep(Brep.JoinBreps(nonPlanarBrep, _tolerance[0])[0] ?? topBrep);
}

public GH_Structure<GH_Brep> Wall(IEnumerable<StbWall> walls)
public GH_Structure<GH_Brep> Wall(IEnumerable<StbWall> walls, IEnumerable<StbOpen> opens)
{
var brepList = new GH_Structure<GH_Brep>();
if (walls == null)
Expand All @@ -326,7 +321,7 @@ public GH_Structure<GH_Brep> Wall(IEnumerable<StbWall> walls)
var curveList = new PolylineCurve[2];
double thickness = BrepMaker.Wall.GetThickness(_sections, wall);
string[] nodeIds = wall.StbNodeIdOrder.Split(' ');
var topPts = new List<Point3d>();
var wallPts = new List<Point3d>();
foreach (string nodeId in nodeIds)
{
var offsetVec = new Vector3d();
Expand All @@ -343,28 +338,83 @@ public GH_Structure<GH_Brep> Wall(IEnumerable<StbWall> walls)
}

StbNode node = _nodes.First(n => n.id == nodeId);
topPts.Add(new Point3d(node.X, node.Y, node.Z) + offsetVec);
wallPts.Add(new Point3d(node.X, node.Y, node.Z) + offsetVec);
}

topPts.Add(topPts[0]);
var centerCurve = new PolylineCurve(topPts);
wallPts.Add(wallPts[0]);
var centerCurve = new PolylineCurve(wallPts);
Vector3d normal = Vector3d.CrossProduct(centerCurve.TangentAtEnd, centerCurve.TangentAtStart);
curveList[0] = new PolylineCurve(topPts.Select(pt => pt + normal * thickness / 2));
curveList[1] = new PolylineCurve(topPts.Select(pt => pt - normal * thickness / 2));
curveList[0] = new PolylineCurve(wallPts.Select(pt => pt + normal * thickness / 2));
curveList[1] = new PolylineCurve(wallPts.Select(pt => pt - normal * thickness / 2));
Brep brep = Brep.CreateFromLoft(curveList, Point3d.Unset, Point3d.Unset, LoftType.Straight, false)[0].CapPlanarHoles(_tolerance[0]);
if (brep != null)
{
if (brep.SolidOrientation == BrepSolidOrientation.Inward)
{
brep.Flip();
}
brep.Faces.SplitKinkyFaces();
}
CheckBrepOrientation(brep);

brep = ApplyWallOpen(opens, wall, wallPts, brep);
brepList.Append(new GH_Brep(brep), new GH_Path(0, i));
}

return brepList;
}

private static void CheckBrepOrientation(Brep brep)
{
if (brep == null)
{
return;
}

if (brep.SolidOrientation == BrepSolidOrientation.Inward)
{
brep.Flip();
}
brep.Faces.SplitKinkyFaces();
}

private Brep ApplyWallOpen(IEnumerable<StbOpen> opens, StbWall wall, IReadOnlyList<Point3d> wallPts, Brep brep)
{
double thickness = BrepMaker.Wall.GetThickness(_sections, wall);
var centerCurve = new PolylineCurve(wallPts);
Vector3d normal = Vector3d.CrossProduct(centerCurve.TangentAtEnd, centerCurve.TangentAtStart);
var openIds = new List<string>();
if (wall.StbOpenIdList != null)
{
openIds.AddRange(wall.StbOpenIdList.Select(openId => openId.id));
foreach (string id in openIds)
{
StbOpen open = opens.First(o => o.id == id);
Point3d[] openCurvePts = GetOpenCurvePts(wallPts, open);
PolylineCurve[] openCurve = GetOpenCurve(thickness, normal, openCurvePts);
Brep openBrep = Brep.CreateFromLoft(openCurve, Point3d.Unset, Point3d.Unset, LoftType.Straight, false)[0].CapPlanarHoles(_tolerance[0]);
CheckBrepOrientation(openBrep);

brep = Brep.CreateBooleanDifference(brep, openBrep, 1)[0];
}
}

return brep;
}

private static PolylineCurve[] GetOpenCurve(double thickness, Vector3d normal, Point3d[] openCurvePts)
{
var openCurve = new PolylineCurve[2];
openCurve[0] = new PolylineCurve(openCurvePts.Select(pt => pt + normal * thickness * 2));
openCurve[1] = new PolylineCurve(openCurvePts.Select(pt => pt - normal * thickness * 2));
return openCurve;
}

private static Point3d[] GetOpenCurvePts(IReadOnlyList<Point3d> wallPts, StbOpen open)
{
var openXVec = new Vector3d(wallPts[1] - wallPts[0]);
openXVec.Unitize();
Vector3d openYVec = Vector3d.ZAxis;

var openCurvePts = new Point3d[5];
openCurvePts[0] = wallPts[0] + openXVec * open.position_X + openYVec * open.position_Y;
openCurvePts[1] = openCurvePts[0] + openXVec * open.length_X;
openCurvePts[2] = openCurvePts[1] + openYVec * open.length_Y;
openCurvePts[3] = openCurvePts[0] + openYVec * open.length_Y;
openCurvePts[4] = openCurvePts[0];

return openCurvePts;
}
}
}
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![download](https://img.shields.io/github/downloads/hrntsm/HoaryFox/total)](https://github.com/hrntsm/HoaryFox/releases)

![Build](https://img.shields.io/github/workflow/status/hrntsm/HoaryFox/Build%20Grasshopper%20Plugin)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/c0a462728dce4983802d447ed67d3e7c)](https://www.codacy.com/gh/hrntsm/HoaryFox/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=hrntsm/HoaryFox&amp;utm_campaign=Badge_Grade)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/c0a462728dce4983802d447ed67d3e7c)](https://www.codacy.com/gh/hrntsm/HoaryFox/dashboard?utm_source=github.com&utm_medium=referral&utm_content=hrntsm/HoaryFox&utm_campaign=Badge_Grade)
[![Maintainability](https://api.codeclimate.com/v1/badges/bc78a575fcf5e9448929/maintainability)](https://codeclimate.com/github/hrntsm/HoaryFox/maintainability)

Grasshopper Component which read ST-Bridge file(.stb) and display its model information.
Expand All @@ -16,45 +16,44 @@ As a experimental function, it creates an analytical model of Karamba from st-br
## Install

1. Download HoaryFox.gha file from [food4rhino](https://www.food4rhino.com/app/hoaryfox) or [release page](https://github.com/hrntsm/HoaryFox/releases)
2. In Grasshopper, choose File > Special Folders > Components folder. Save the gha file there.
2. In Grasshopper, choose File > Special Folders > Components folder. Save the gha file there.
3. Right-click the file > Properties > make sure there is no "blocked" text
4. Restart Rhino and Grasshopper
5. Enjoy!

Please see [the documentation site](https://hiron.dev/HoaryFox/) for detailed instructions.

## Usage

Input st-bridge file path, output some its tag data(StbColumn, StbGirder, StbPost, StbBeam, StbBrace, StbSlab).
Please refer to Samples directory files and see [the documentation site](https://hiron.dev/HoaryFox/) for detailed instructions.

Support for ST-bridge ver2.0 is now available from HoaryFox ver1.1.
If you need more information, send direct message to my twitter account.

Please refer to Samples directory files.

Please see [the documentation site](https://hiron.dev/HoaryFox/) for detailed instructions.

## Karamba3D Integration

Conversion of data into Karamba3D supports only beam elements.
Mesh elements such as floor and wall are not supported.
L-type and C-type cross-sections are replaced by rectangular cross-sections with equivalent axial cross-sections because Karamba3D does not support them.
Output is STB1.4 only, STB2.0 is not supported yet.
Output is STB2.0.

## What is ST-Bridge

Quote from [building SMART Japan Structural Design Subcommittee](https://en.building-smart.or.jp/meeting/buildall/structural-design/) doing making specifications of ST-Bridge.

> ST Bridge is the standardized format for data sharing in Japan’s structural engineering industry.
> + Simpler to use than IFC due to the clearly defined the range of use
> + Integrate Japanese original methods of drawing methodology (Grids, part placement and section annotations, reinforcement information)
> + Aim for coordination between domestic structural applications, building skeleton surveying applications, 3D Object CAD
>
> - Simpler to use than IFC due to the clearly defined the range of use
> - Integrate Japanese original methods of drawing methodology (Grids, part placement and section annotations, reinforcement information)
> - Aim for coordination between domestic structural applications, building skeleton surveying applications, 3D Object CAD
## Contact information

[![Twitter](https://img.shields.io/twitter/follow/hiron_rgkr?style=social)](https://twitter.com/hiron_rgkr)
+ HP : [https://hiron.dev/](https://hiron.dev/)
+ Mail : support(at)hrntsm.com
+ change (at) to @

- HP : [https://hiron.dev/](https://hiron.dev/)
- Mail : support(at)hrntsm.com
- change (at) to @

## Donation

Expand Down
8 changes: 8 additions & 0 deletions website/docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ title: Changelog

---

## [v2.2.0 - 2022-3-21](https://github.com/hrntsm/HoaryFox/releases/tag/v2.2.0)

### 追加

- RC 壁の壁開口に対応した。

---

## [v2.1.1 - 2022-1-6](https://github.com/hrntsm/HoaryFox/releases/tag/v2.1.1)

### 追加
Expand Down
5 changes: 3 additions & 2 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,11 @@ module.exports = {
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} hrntsm, Inc. Built with Docusaurus.`,
copyright: `Copyright © ${new Date().getFullYear()} hrntsm, HF Technologies. Built with Docusaurus.`,
},
algolia: {
apiKey: '28d1c171c6f64559d0a227407c166cee',
appId: '4T3ZT5E0SK',
apiKey: '574347720fea27b633bc711c59b8f289',
indexName: 'hoaryfox',
},
prism: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ title: Changelog

---

## [v2.2.0 - 2022-3-21](https://github.com/hrntsm/HoaryFox/releases/tag/v2.2.0)

### ADD

- Support Wall opens.

---

## [v2.1.1 - 2022-1-6](https://github.com/hrntsm/HoaryFox/releases/tag/v2.1.1)

### ADD
Expand Down
Loading

0 comments on commit 4c12dd2

Please sign in to comment.