|
| 1 | +##Copyright 2009-2015 Thomas Paviot ([email protected]) |
| 2 | +## |
| 3 | +##This file is part of pythonOCC. |
| 4 | +## |
| 5 | +##pythonOCC is free software: you can redistribute it and/or modify |
| 6 | +##it under the terms of the GNU Lesser General Public License as published by |
| 7 | +##the Free Software Foundation, either version 3 of the License, or |
| 8 | +##(at your option) any later version. |
| 9 | +## |
| 10 | +##pythonOCC is distributed in the hope that it will be useful, |
| 11 | +##but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | +##MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | +##GNU Lesser General Public License for more details. |
| 14 | +## |
| 15 | +##You should have received a copy of the GNU Lesser General Public License |
| 16 | +##along with pythonOCC. If not, see <http://www.gnu.org/licenses/>. |
| 17 | + |
| 18 | +from OCC.gp import gp_Pnt |
| 19 | +from OCC.BRepBuilderAPI import BRepBuilderAPI_MakePolygon |
| 20 | +from OCC.GeomAbs import GeomAbs_Arc |
| 21 | +from OCC.BRepOffsetAPI import BRepOffsetAPI_MakeEvolved |
| 22 | + |
| 23 | +from OCC.Display.SimpleGui import init_display |
| 24 | +display, start_display, add_menu, add_function_to_menu = init_display() |
| 25 | + |
| 26 | + |
| 27 | +def evolved_shape(): |
| 28 | + P = BRepBuilderAPI_MakePolygon() |
| 29 | + P.Add(gp_Pnt(0., 0., 0.)) |
| 30 | + P.Add(gp_Pnt(200., 0., 0.)) |
| 31 | + P.Add(gp_Pnt(200., 200., 0.)) |
| 32 | + P.Add(gp_Pnt(0., 200., 0.)) |
| 33 | + P.Add(gp_Pnt(0., 0., 0.)) |
| 34 | + wprof = BRepBuilderAPI_MakePolygon(gp_Pnt(0., 0., 0.), gp_Pnt(-60., -60., -200.)) |
| 35 | + S = BRepOffsetAPI_MakeEvolved(P.Wire(), |
| 36 | + wprof.Wire(), |
| 37 | + GeomAbs_Arc, |
| 38 | + True, |
| 39 | + False, |
| 40 | + True, |
| 41 | + 0.0001) |
| 42 | + S.Build() |
| 43 | + display.DisplayShape(S.Shape(), update=True) |
| 44 | + |
| 45 | +if __name__ == '__main__': |
| 46 | + evolved_shape() |
| 47 | + start_display() |
0 commit comments