netgen/python/occ.py

41 lines
1.1 KiB
Python
Raw Normal View History

2021-09-07 19:28:39 +05:00
""" Netgen OCC documentation
This module provides the Netgen OCCGeometry class, as well as Python wrappers
for OpenCascade functionality. This allows the construction from scratch, as well as
editing geometries imported via STEP format.
Most of the classes are directly py-wrapped from the OCCT classes.
For more detailed documentation consult the OCCT docs, a good starting point is
https://dev.opencascade.org/doc/refman/html/class_b_rep_builder_a_p_i___make_shape.html
"""
from .libngpy._NgOCC import *
from .meshing import meshsize
gp_Ax3 = Axes
gp_Ax1 = Axis
Translation = gp_Trsf.Translation
Rotation = gp_Trsf.Rotation
Mirror = gp_Trsf.Mirror
2021-09-09 17:12:06 +05:00
2021-09-10 15:09:51 +05:00
def Rectangle(l,w): return WorkPlane().Rectangle(l,w)
def MoveTo(x,y): return WorkPlane().MoveTo(x,y)
def LineTo(x,y): return WorkPlane().LineTo(x,y)
def Line(l): return WorkPlane().Line(l)
2021-09-13 12:51:49 +05:00
unit_square_shape = WorkPlane().Line(1, name="bottom").Rotate(90) \
.Line(1, name="right").Rotate(90) \
.Line(1, name="top").Rotate(90) \
.Line(1, name="left").Rotate(90).Face()
unit_square = OCCGeometry(unit_square_shape, dim=2)