# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
# Module : GEOM_SWIG
+## @defgroup sketcher gsketcher - Wrapper to help the creation of simple sketches
+# @{
+# @details
+# This module provides the user with a simple python API
+# to realize various sketches from the GEOM text user interface.
+# @n Example:
+# @code
+# import GEOM
+# from salome.geom import geomBuilder
+# geompy = geomBuilder.New(salome.myStudy)
+#
+# # create a wire for sketcher
+# geomObj_1 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
+#
+# # Create the sketch
+# sk = geompy.Sketcher2D()
+# sk.addPoint(0.000000, 0.000000)
+# sk.addSegmentAbsolute(50.000000, 50.000000)
+# sk.addSegmentPerpY(0.000000)
+# sk.addArcAbsolute(0.000000, 0.000000)
+# sk.close()
+# Sketch_1 = sk.wire(geomObj_1)
+#
+# # add objects in the study
+# geompy.addToStudy( Sketch_1, 'Sketch_1' )
+#
+# # update object browser
+# salome.sg.updateObjBrowser(1)
+# @endcode
+# @n Additionnal examples can be found as unit tests in the source code.
+# @}
+
"""
\namespace geompy
\brief 2D and 3D Sketcher interfaces
# Use geompy.Sketcher3D() method to obtain an instance of this class.
#
# @ref tui_3dsketcher_page "Example"
+# @ingroup sketcher
class Sketcher3D:
"""
3D sketcher interface.
# Coordinates are considered as absolute.
# If the first point of sketcher is not yet defined, the first point
# from the listCoords will become the first sketcher point.
- # @param X1, Y1, Z1, X2, Y2, Z2, ... Coordinates of points
+ # @param listCoords X1, Y1, Z1, X2, Y2, Z2, ... Coordinates of points
def addPointsAbsolute (self, *listCoords):
"""
Add one or more points, sequentially connected with straight segments.
# Coordinates are considered relative to the previous point.
# If the first point of sketcher is not yet defined, the
# origin (0, 0, 0) will become the first sketcher point.
- # @param X1, Y1, Z1, X2, Y2, Z2, ... Coordinates of points
+ # @param listCoords X1, Y1, Z1, X2, Y2, Z2, ... Coordinates of points
def addPointsRelative (self, *listCoords):
"""
Add one or more points, sequentially connected with straight segments.
# @param axes can be: "OXY", "OYZ" or "OXZ"
# @param angle angle in a plane, defined by the \a axes
# @param height height from the plane, defined by the \a axes
- # @param radius distance to the coordinate system origin
+ # @param length distance to the coordinate system origin
def addPointRadiusAngleHRelative (self, length, angle, height, axes="OXY"):
"""
Add one straight segment, defined by two angles and length.
self.geompyD._autoPublish(wire, theName, "wire")
return wire
-# An interface to build a 2D Sketcher step-by-step.
+## An interface to build a 2D Sketcher step-by-step.
# Use geompy.Sketcher2D() method to obtain an instance of this class.
-
+# @ingroup sketcher
class Sketcher2D:
"""
2D sketcher interface.