Skip to content

density property on TPMS class #105

@ricardo0115

Description

@ricardo0115

Description

The following code snippet raises an AssertionError:

from microgen import Tpms
from microgen.shape.surface_functions import gyroid

geometry = Tpms(
    surface_function=gyroid,
    offset=0.16,
    resolution=30,
)

assert geometry.density is not None

After checking the implementation, it seems that the Tpms class currently cannot compute the density of a TPMS structure when it is initialized using an offset rather than a density.
(See [tpms.py#L43](

class Tpms(Shape):
))

Suggestion

It might be useful to:

  • Add a density property to the Tpms class that can handle geometries defined via offset,
    or
  • Clarify in the documentation that density is unavailable when an offset is used.

@kmarchais please let me know if I’m misunderstanding how the API is intended to be used 🙂

Metadata

Metadata

Labels

bugSomething isn't workingenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions