Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show beam ref sides #378

Merged
merged 9 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Refactored `compas_timber.connections.LapJoint` to comply with the new system.
* Changed `THalfLapJoint`, `LHalfLapJoint`, `XHalfLapJoint` from `compas_timber.connections` so that they use the `Lap` BTLx processing.
* Renamed all `X/T/LHalfLapJoint` classes to `X/T/LLapJoint`.
* Changed `Show_beam_faces` gh component to `Show_beam_ref_side`, which now takes an `int` index and shows the corresponding face
including origin corner.

### Removed

Expand Down
29 changes: 0 additions & 29 deletions src/compas_timber/ghpython/components/CT_ShowBeamFaces/code.py

This file was deleted.

Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import rhinoscriptsyntax as rs
from compas.geometry import Line
from compas.scene import Scene
from compas_rhino.conversions import frame_to_rhino
from ghpythonlib.componentbase import executingcomponent as component


class BTLxRefFace(component):
def RunScript(self, element, ref_side_index):
if not element:
return
if not ref_side_index:
ref_side_index = 0
return self.get_srf(element, ref_side_index)

def get_srf(self, element, ref_side_index):
face = element.side_as_surface(ref_side_index)
rh_srf = rs.AddPlaneSurface(frame_to_rhino(face.frame), face.xsize, face.ysize)
ln = Line(face.point_at(0, face.ysize / 3.0), face.point_at(face.ysize * 3 / 4, 0))
scene = Scene()
scene.add(ln)
ln = scene.draw()
return rh_srf, ln[0]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "Show Reference Side",
"nickname": "ShowRefSide",
"category": "COMPAS Timber",
"subcategory": "Show",
"description": "Shows the element side based on BTLx ref_side_index.",
"exposure": 4,
"ghpython": {
"isAdvancedMode": true,
"iconDisplay": 0,
"inputParameters": [
{
"name": "Element",
"description": "Element",
"typeHintID": "none",
"scriptParamAccess": 0
},
{
"name": "Reference Side",
"description": "integer 1-6 corresponding to BTLx reference side.",
"typeHintID": "int",
"scriptParamAccess": 0
}
],
"outputParameters": [
{
"name": "Reference Side",
"description": "Surface and Line showing Reference Side and orientation(triangle at origin corner)."
}
]
}
}
Loading