Changes between Version 47 and Version 48 of PythonOcc/primitives


Ignore:
Timestamp:
Nov 15, 2015, 12:49:29 PM (9 years ago)
Author:
dpenko
Comment:

Posodobil kodo pri "Izdelava nagiba (Draft_Angle)"

Legend:

Unmodified
Added
Removed
Modified
  • PythonOcc/primitives

    v47 v48  
    709709{{{
    710710#!python
    711 nagib = BRepOffsetAPI_DraftAngle(Oblika)
    712 for f in topo.faces():
    713     surf = Handle_Geom_Plane_DownCast(BRep_Tool_Surface(f)).GetObject()
    714     dirf = surf.Pln().Axis().Direction()
    715     ddd = gp_Dir(0,0,1)
    716     if dirf.IsNormal(ddd, Precision_Angular()):
    717         nagib.Add(f, ddd, math.radians(25), gp_Pln(gp_Ax3(gp_XOY())))
     711topExp = TopExp_Explorer()
     712topExp.Init(oblika, TopAbs_FACE)
     713while topExp.More():
     714    face = topods_Face(topExp.Current())
     715    surface = Handle_Geom_Plane_DownCast(BRep_Tool_Surface(face)).GetObject()
     716    smer_normale = surface.Pln().Axis().Direction()
     717    os = gp_Dir(0, 0, 1)
     718    if smer_normale.IsNormal(os, precision_Angular()):
     719        nagib.Add(face, os, math.radians(15), gp_Pln(gp_Ax3(gp_XOY())))
     720    topExp.Next()
    718721nagib.Build()
    719722}}}