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

Better mesh surface checks #82

Open
meganrm opened this issue Sep 28, 2022 · 0 comments
Open

Better mesh surface checks #82

meganrm opened this issue Sep 28, 2022 · 0 comments

Comments

@meganrm
Copy link
Member

meganrm commented Sep 28, 2022

Use Case

We need to make sure ingredients don't overlap with surfaces defined by a mesh

Solution

This is some code we removed that may be a good check to do but is currently redundant with other surface checks

        # the compartment the ingr belongs to
        # current_ingr_compartment = self.get_compartment(self.env)
        # for compartment in self.env.compartments:
        #     if current_ingr_compartment.name == compartment.name:
        #         continue
        #     distances, ingr_indexes = compartment.OGsrfPtsBht.query(packing_location)

        #     # NOTE: this could be optimized by walking down the sphere tree representation
        #     # of the instead of going right to the bottom
        #     if distances < self.encapsulating_radius + compartment.encapsulating_radius:
        #         # pos_of_attempting_ingr = self.get_new_pos(
        #         #     self, packing_location, rotation, self.positions[total_levels - 1]
        #         # )
        #         distances, ingr_indexes = compartment.OGsrfPtsBht.query(
        #             [packing_location]
        #         )

        #         radii = [self.radius]
        #         overlap_distance = distances - numpy.array(radii)
        #         overlap_indexes = numpy.nonzero(overlap_distance < 0.0)[0]
        #         if len(overlap_indexes) != 0:
        #             return True

Alternatives

Please describe any alternatives you've considered, even if you've dismissed them

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

No branches or pull requests

1 participant