# -*- coding: iso-8859-1 -*-
#
-# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2021 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
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
+## \defgroup simplesketcher sketcher - Simplified sketcher API
+# \{
+# \details
+# This module provides simplified access to the 2D sketcher functionality of Geometry module.
+#
+# \note This module is deprecated, refer to \ref gsketcher for more details
+# \}
+
"""
This module provides the user with a simple python API to realize
various sketches from the GEOM text user interface.
wire = mysketcher.getGeomWire()
# Put it in the study
- import geompy
+ from salome.geom import geomBuilder
+ geompy = geomBuilder.New()
geompy.addToStudy( wire, 'mysketch' )
-Additionnal examples can be found as unit tests in the source code.
+Additional examples can be found as unit tests in the source code.
"""
geompyEnable = True
try:
- import geompy
+ from salome.kernel.deprecation import is_called_by_sphinx
+ if not is_called_by_sphinx():
+ import salome
+ salome.salome_init()
+ import GEOM
+ from salome.geom import geomBuilder
+ geompy = geomBuilder.New()
+ pass
+ pass
except:
geompyEnable = False
-
+ pass
+##
+# \ingroup simplesketcher
class Sketcher:
__sketch = None
expectedResult = "Sketcher:F 1.234 4.321:TT 2.234 5.321"
result = mysketcher.toString()
- print "sketcher=",mysketcher.toString()
+ print("sketcher=",mysketcher.toString())
if result == expectedResult:
- print "OK"
+ print("OK")
else:
- print "Not OK"
+ print("Not OK")
def TEST_usingGeom():
mysketcher = Sketcher()