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

FreeContour BTLxProcessing #382

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

FreeContour BTLxProcessing #382

wants to merge 17 commits into from

Conversation

obucklin
Copy link
Contributor

@obucklin obucklin commented Jan 30, 2025

This adds the FreeContour BTLx Processing and updates the Plate element to function as a BTLx Part. The Plate.geometry is now created with FreeContour (and other) processings. The SurfaceModel and SurfaecModel.Window have been updated to generate FreeContour features and output BTLx files with all elements.

image
image
image
image
image

What type of change is this?

  • Bug fix in a backwards-compatible manner.
  • New feature in a backwards-compatible manner.
  • Breaking change: bug fix or new feature that involve incompatible API changes.
  • Other (e.g. doc update, configuration, etc)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I added a line to the CHANGELOG.md file in the Unreleased section under the most fitting heading (e.g. Added, Changed, Removed).
  • I ran all tests on my computer and it's all green (i.e. invoke test).
  • I ran lint on my computer and there are no errors (i.e. invoke lint).
  • I added new functions/classes and made them available on a second-level import, e.g. compas_timber.datastructures.Beam.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate)

@obucklin obucklin marked this pull request as ready for review January 31, 2025 13:52
@obucklin obucklin linked an issue Jan 31, 2025 that may be closed by this pull request
Copy link
Contributor

@chenkasirer chenkasirer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left some comments.
if @papachap can have a look it would be great

src/compas_timber/fabrication/btlx.py Outdated Show resolved Hide resolved
src/compas_timber/fabrication/btlx.py Show resolved Hide resolved
src/compas_timber/fabrication/free_contour.py Show resolved Hide resolved
src/compas_timber/fabrication/btlx.py Show resolved Hide resolved
# create subprocessing elements
if self.subprocessings:
for subprocessing in self.subprocessings:
processing_element.append(self._create_processing(subprocessing))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as BTLxWriter_create_processing() gets removed, recursively call create_processing here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@papachap can you confirm that this works as currently written? is there a processing we could test this on?

CHANGELOG.md Show resolved Hide resolved
@obucklin obucklin mentioned this pull request Feb 6, 2025
10 tasks
@obucklin
Copy link
Contributor Author

obucklin commented Feb 6, 2025

I responded to @chenkasirer s comments. Will wait for @papachap :-)

@@ -155,8 +155,8 @@ def _create_project_element(self, model):
# create parts element
parts_element = ET.SubElement(project_element, "Parts")
# create part elements for each beam
for i, beam in enumerate(model.beams): # TODO: we need to add at least Plates to this too.
part_element = self._create_part(beam, i)
for i, element in enumerate(list(model.beams) + list(model.plates)):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe update the _create_part() method as well to accept an element instead of a beam and adjust the docstring.

processings : list
A list of the processings applied to the beam.
et_element : :class:`~xml.etree.ElementTree.Element`
The ET element of the BTLx part.

"""

def __init__(self, beam, order_num):
self.beam = beam
def __init__(self, element, order_num):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the docstring accordingly.

)
# create parameter subelements
for key, value in self.params_dict.items():
print(key, value)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove print

@@ -177,7 +193,7 @@ def compute_aabb(self, inflate=0.0):
box.zsize += inflate
return box

def compute_obb(self, inflate=0.0):
def compute_obb(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update docstring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BTLx contour processing for plates
3 participants