Skip to content

Commit

Permalink
Removed some redundant classes in cq_geometry.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelgale committed Mar 28, 2024
1 parent fa4609f commit c64ace7
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 485 deletions.
12 changes: 4 additions & 8 deletions cqkit/cq_discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@
from OCP.BRepLProp import BRepLProp_CLProps
from OCP.BRepMesh import BRepMesh_IncrementalMesh
from OCP.GCPnts import GCPnts_AbscissaPoint, GCPnts_QuasiUniformAbscissa
from OCP.gp import gp_Dir
from OCP.TopAbs import TopAbs_FACE, TopAbs_Orientation, TopAbs_VERTEX
from OCP.TopExp import TopExp_Explorer
from OCP.TopAbs import TopAbs_Orientation
from OCP.TopLoc import TopLoc_Location
from OCP.TopoDS import TopoDS_Face, TopoDS_Iterator, TopoDS_Vertex

BRep_Tool.Triangulation = BRep_Tool.Triangulation_s
GCPnts_AbscissaPoint.Length = GCPnts_AbscissaPoint.Length_s
Expand All @@ -51,7 +48,6 @@
from OCC.Core.TopoDS import TopoDS_Face, TopoDS_Iterator, TopoDS_Vertex


import cadquery as cq
from cadquery import *


Expand Down Expand Up @@ -138,13 +134,13 @@ def triangle_mesh_solid(solid, lin_tol=1e-2, ang_tol=0.5):
)
for i in range(1, num_tri + 1):
idx = list(tri.Value(i).Get())
ci = [0, 2, 1] if rev else [0, 1, 2]
ci = (0, 2, 1) if rev else (0, 1, 2)
for j in ci:
pt = [
pt = (
vtx.Value(idx[j] - 1).Transformed(txf).X(),
vtx.Value(idx[j] - 1).Transformed(txf).Y(),
vtx.Value(idx[j] - 1).Transformed(txf).Z(),
]
)
if pt not in vertices:
vertices.append(pt)
idx[j] = vertices.index(pt)
Expand Down
2 changes: 1 addition & 1 deletion cqkit/cq_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@

Interface_Static_SetIVal = Interface_Static.SetIVal_s
Interface_Static_SetCVal = Interface_Static.SetCVal_s
OCCT_VERSION = "7.5"
OCCT_VERSION = str(OCP.__version__)


class suppress_stdout_stderr(object):
Expand Down
Loading

0 comments on commit c64ace7

Please sign in to comment.