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

Fabrication initial PR #138

Merged
merged 53 commits into from
Dec 4, 2023
Merged

Fabrication initial PR #138

merged 53 commits into from
Dec 4, 2023

Conversation

obucklin
Copy link
Contributor

@obucklin obucklin commented Oct 24, 2023

Fabrication Branch initial PR

introduces BTLx output to Compas_Timber

TODO:
-Documentation, esp. to prepare for MAS T2
-Implement more Joints
-add processes and factories for eg X-Lap Joint

  • 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)

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.

Good job! left some comments. Will probably need another iteration.

I'm not sure I fully get the relationships between BTLx, BTLxPart and BTLxJoint etc, maybe we could sit together and whiteboard it. My general feeling is that we could remove some redundancies between these and the input datastructure (i.e. TimberAssembly)

elif angle_vectors(normal, -self.beam_a.frame.zaxis) < 0.001:
indices.append(2)
else:
raise ("part not aligned with corner normal, no French Ridge Lap possible")
Copy link
Contributor

Choose a reason for hiding this comment

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

there's a BeamJoiningError you could raise 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.

done

indices.append(2)
else:
raise ("part not aligned with corner normal, no French Ridge Lap possible")
print(indices)
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove debug prints.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

elif abs(angle_vectors(normal, -self.beam_b.frame.zaxis) - math.pi) < 0.001:
indices.append(2)
else:
raise ("part not aligned with corner normal, no French Ridge Lap possible")
Copy link
Contributor

Choose a reason for hiding this comment

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

there's a BeamJoiningError you could raise 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.

done

src/compas_timber/fabrication/__init__.py Outdated Show resolved Hide resolved
Comment on lines 463 to 470
# if side == "start":
# tmin = min(x.keys())
# if tmin < 0.0:
# ds = tmin * self.length # should be negative
# elif side == "end":
# tmax = max(x.keys())
# if tmax > 1.0:
# de = (tmax - 1.0) * self.length
Copy link
Contributor

Choose a reason for hiding this comment

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

remove?

Comment on lines +134 to +150
for index, beam in enumerate(self.beams):
start_distance = min(
[
beam.centerline.start.distance_to_point(self.beams[index - 1].centerline.start),
beam.centerline.start.distance_to_point(self.beams[index - 1].centerline.end),
]
)
end_distance = min(
[
beam.centerline.end.distance_to_point(self.beams[index - 1].centerline.start),
beam.centerline.end.distance_to_point(self.beams[index - 1].centerline.end),
]
)
if start_distance < end_distance:
self._ends[str(beam.key)] = "start"
else:
self._ends[str(beam.key)] = "end"
Copy link
Contributor

@chenkasirer chenkasirer Dec 1, 2023

Choose a reason for hiding this comment

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

Not for this PR maybe but for future reference, I think it'll be clearer if we have the (estimate) location of the joint and we then check it against either the start or end of each beam. We could set the location when first joining the beam, we have all information needed there.

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.

LGTM

Copy link
Contributor Author

@obucklin obucklin left a comment

Choose a reason for hiding this comment

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

added docstrings, resolved comments.

@obucklin obucklin merged commit f5b0ba4 into main Dec 4, 2023
3 of 12 checks passed
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.

2 participants