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

XHalfLap doesnt run outside Rhino? #179

Open
chenkasirer opened this issue Jan 23, 2024 · 5 comments
Open

XHalfLap doesnt run outside Rhino? #179

chenkasirer opened this issue Jan 23, 2024 · 5 comments
Assignees

Comments

@chenkasirer
Copy link
Contributor

chenkasirer commented Jan 23, 2024

Tried writing unittests for the half lap joint and couldn't get it to run just with code (CPython)
Inside Rhino it seems to be running fine.

assembly = TimberAssembly()
beam_a = Beam.from_endpoints(Point(0.5, 0, 0), Point(0.5, 1, 0), 0.2, 0.2, z_vector=Vector(0, 0, 1))
beam_b = Beam.from_endpoints(Point(0, 0.5, 0), Point(1, 0.5, 0), 0.2, 0.2, z_vector=Vector(0, 0, 1))
assembly.add_beam(beam_a)
assembly.add_beam(beam_b)

from compas_timber.connections import XHalfLapJoint
joint = XHalfLapJoint.create(assembly, beam_a, beam_b)
tests\compas_timber\test_joint.py:163: in test_joint_create_kwargs_passthrough_xhalflap
    joint = XHalfLapJoint.create(assembly, beam_a, beam_b)
src\compas_timber\connections\joint.py:130: in create
    joint.add_features()
src\compas_timber\connections\x_halflap.py:172: in add_features
    negative_brep_beam_a, negative_brep_beam_b = self._create_negative_volumes()
src\compas_timber\connections\x_halflap.py:144: in _create_negative_volumes
    planes_a = self._sort_beam_planes(self.beam_a, plane_cut_vector_a)
src\compas_timber\connections\x_halflap.py:101: in _sort_beam_planes
    planes_angles, planes = zip(*sorted(zip(planes_angles, planes)))
E   TypeError: '<' not supported between instances of 'Plane' and 'Plane'
@chenkasirer
Copy link
Contributor Author

could be sorted with the zip there is behaving differently in CPython vs. IronPython (or just 2.7 vs. 3)

@obucklin
Copy link
Contributor

this function only returns the planes anyways, so we can just sort planes with planes_angles as key. I think that's how I did it in the other laps. I'll change it real quick

@obucklin
Copy link
Contributor

How do I test with CPython?

@obucklin
Copy link
Contributor

@chenkasirer maybe you can test it real quick. I just changed it

@chenkasirer
Copy link
Contributor Author

yup seems to have worked. I wrote a few unittests you can find them in tests/compas_timber/
you run them using invoke test and they should all pass.

When opening a PR or when pushing new commits to it, it'll run them automatically as Github Actions.
You can click on Details next to an action that failed to checkout why it failed. All checks should be green before we can merge.

Image

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

No branches or pull requests

3 participants