padne.mesh¶
Attributes¶
Exceptions¶
Exception raised when CGAL mesh generation fails due to invalid geometry. |
Classes¶
Base class for protocol classes. |
|
A simple class that stores objects with indices. |
|
A discrete 1-form defined on the (h)edges of a mesh. |
|
A discrete 2-form defined on the faces of a mesh. |
|
This class is responsible for generating a mesh from a Shapely polygon. |
Module Contents¶
- class padne.mesh.HasIndex[source]¶
Bases:
ProtocolBase class for protocol classes.
Protocol classes are defined as:
class Proto(Protocol): def meth(self) -> int: ...
Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).
For example:
class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check
See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:
class GenProto[T](Protocol): def meth(self) -> T: ...
- class padne.mesh.Face[source]¶
- class padne.mesh.IndexStore[T: HasIndex][source]¶
A simple class that stores objects with indices.
- class padne.mesh.Mesh[source]¶
- class padne.mesh.ZeroForm[source]¶
-
- values: numpy.ndarray[source]¶
- class padne.mesh.OneForm[source]¶
A discrete 1-form defined on the (h)edges of a mesh.
- values: numpy.ndarray[source]¶
- class padne.mesh.TwoForm[source]¶
A discrete 2-form defined on the faces of a mesh.
- values: numpy.ndarray[source]¶
- exception padne.mesh.MeshingException[source]¶
Bases:
RuntimeErrorException raised when CGAL mesh generation fails due to invalid geometry.
This includes cases such as: - Self-intersecting polygons with unauthorized constraint intersections - Degenerate edges that are too short (near-duplicate vertices) - Other geometric degeneracies that prevent mesh generation
With CGAL_DEBUG enabled, these issues are detected early through CGAL’s internal precondition checking, preventing crashes and providing clear error messages.