Version: 9.15.0
Home

An interface to build a 2D Sketcher step-by-step. More...

Public Member Functions

def __init__ (self, geompyD)
 
def addPoint (self, x, y)
 Add one point. More...
 
def addAngle (self, angle)
 Add angle. More...
 
def addSegmentParalX (self, x)
 Add segment, which sequentially connects the previous point with a point lying on a line parallel to the axis Ox and the value x = param x. More...
 
def addSegmentParalXToZero (self)
 Add segment, which sequentially connects the previous point with a point lying on a line parallel to the axis Ox and the value x = 0 The current point will be the previous value to the coordinate y. More...
 
def addSegmentParalY (self, y)
 Add segment, which sequentially connects the previous point with a point lying on a line parallel to the axis Oy and the value y = param y. More...
 
def addSegmentParalYToZero (self)
 Add segment, which sequentially connects the previous point with a point lying on a line parallel to the axis Ox and the value x = 0 The current point will be the previous value to the coordinate y. More...
 
def addSegmentAbsolute (self, x, y)
 Add segment, which sequentially connects the given point with previous point. More...
 
def addSegmentRelative (self, dx, dy)
 Add segment, which sequentially connects the given point with previous point Coordinates are considered relative to the previous point. More...
 
def addSegmentAngleLength (self, angle, length)
 Add one straight segment, defined by angle and length. More...
 
def addSegmentAngleX (self, angle, x)
 Add one straight segment, defined by angle and intersect straight x= param x. More...
 
def addSegmentAngleY (self, angle, y)
 Add one straight segment, defined by angle and intersect straight y= param y. More...
 
def addSegmentPerpLength (self, length)
 Add one straight segment, defined by perpendicular(angle=90) and length. More...
 
def addSegmentPerpX (self, x)
 Add one straight segment, defined by perpendicular(angle=90) and intersect straight x= param x. More...
 
def addSegmentPerpY (self, y)
 Add one straight segment, defined by perpendicular(angle=90) and intersect straight y= param y. More...
 
def addSegmentLength (self, length)
 Add one straight segment, defined by previous direction and length. More...
 
def addSegmentX (self, x)
 Add one straight segment, defined by previous direction and intersect straight x= param x. More...
 
def addSegmentY (self, y)
 Add one straight segment, defined by previous direction and intersect straight y= param y. More...
 
def addSegmentDirectionLength (self, dx, dy, length)
 Add one straight segment, defined by direction and length. More...
 
def addSegmentDirectionX (self, dx, dy, x)
 Add one straight segment, defined by direction and intersect straight x= param x. More...
 
def addSegmentDirectionY (self, dx, dy, y)
 Add one straight segment, defined by direction and intersect straight y= param y. More...
 
def addArcAbsolute (self, x, y)
 Add arc, which connects the given point with previous point Coordinates are considered as absolute. More...
 
def addArcRelative (self, dx, dy)
 Add arc, which connects the given point with previous point Coordinates are considered relative to the previous point. More...
 
def addArcRadiusAbsolute (self, x, y, radius, flag)
 Add arc, defined by radius and coordinates of next point. More...
 
def addArcRadiusRelative (self, dx, dy, radius, flag)
 Add arc, defined by radius and coordinates of next point. More...
 
def addArcCenterAbsolute (self, x, y, xc, yc, flag1, flag2)
 Add arc, defined by coordinates of next point and coordinates of center. More...
 
def addArcCenterRelative (self, dx, dy, xc, yc, flag1, flag2)
 Add arc, defined by coordinates of next point and coordinates of center. More...
 
def addArcAngleRadiusLength (self, angle, radius, length)
 Add arc, defined by angle, radius and length. More...
 
def addArcPerpRadiusLength (self, radius, length)
 Add arc, defined by perpendicular(angle=90), radius and length. More...
 
def addArcRadiusLength (self, radius, length)
 Add arc, defined by previous direction, radius and length. More...
 
def addArcDirectionRadiusLength (self, dx, dy, radius, length)
 Add arc, defined by direction, radius and length. More...
 
def close (self)
 Set to close the wire
More...
 
def wire (self, WorkingPlane=[0, 0, 0, 0, 0, 1, 1, 0, 0], theName=None)
 Obtain the sketcher result as a wire. More...
 
def face (self, WorkingPlane=[0, 0, 0, 0, 0, 1, 1, 0, 0], theName=None)
 Obtain the sketcher result as a face. More...
 

Data Fields

 geompyD
 
 myCommand
 
 closed
 

Detailed Description

An interface to build a 2D Sketcher step-by-step.

Use geompy.Sketcher2D() method to obtain an instance of this class. <>

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  geompyD 
)

Member Function Documentation

◆ addPoint()

def addPoint (   self,
  x,
  y 
)

Add one point.

Used to set the starting point

Parameters
x,y- Coordinates of point

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addAngle()

def addAngle (   self,
  angle 
)

Add angle.

Used to set the angle for further building

Parameters
angle- angle in a plane

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addSegmentParalX()

def addSegmentParalX (   self,
  x 
)

Add segment, which sequentially connects the previous point with a point lying on a line parallel to the axis Ox and the value x = param x.

The current point will be the previous value to the coordinate y and new value to the coordinate x. Coordinate is considered relative to the previous point.

Parameters
x- Coordinate of point on axis Ox

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addSegmentParalXToZero()

def addSegmentParalXToZero (   self)

Add segment, which sequentially connects the previous point with a point lying on a line parallel to the axis Ox and the value x = 0 The current point will be the previous value to the coordinate y.

References Sketcher3D.myCommand, and Sketcher2D.myCommand.

◆ addSegmentParalY()

def addSegmentParalY (   self,
  y 
)

Add segment, which sequentially connects the previous point with a point lying on a line parallel to the axis Oy and the value y = param y.

The current point will be the previous value to the coordinate x and new value to the coordinate y. Coordinate is considered relative to the previous point.

Parameters
y- Coordinate of point on axis Oy

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addSegmentParalYToZero()

def addSegmentParalYToZero (   self)

Add segment, which sequentially connects the previous point with a point lying on a line parallel to the axis Ox and the value x = 0 The current point will be the previous value to the coordinate y.

References Sketcher3D.myCommand, and Sketcher2D.myCommand.

◆ addSegmentAbsolute()

def addSegmentAbsolute (   self,
  x,
  y 
)

Add segment, which sequentially connects the given point with previous point.

Coordinates are considered as absolute.

Parameters
x,y- Coordinates of point

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addSegmentRelative()

def addSegmentRelative (   self,
  dx,
  dy 
)

Add segment, which sequentially connects the given point with previous point Coordinates are considered relative to the previous point.

If the first point of sketcher is not yet defined, the origin (0, 0) will become the first sketcher point.

Parameters
dx,dy- Coordinates of point relative a previous point

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addSegmentAngleLength()

def addSegmentAngleLength (   self,
  angle,
  length 
)

Add one straight segment, defined by angle and length.

If the first point of sketcher is not yet defined, the origin (0, 0) will become the first sketcher point. The angle and length coordinates are defined in a local coordinate system which origin is the last point of the sketch

Parameters
angle- angle in a plane
length- length of the segment

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addSegmentAngleX()

def addSegmentAngleX (   self,
  angle,
  x 
)

Add one straight segment, defined by angle and intersect straight x= param x.

If the first point of sketcher is not yet defined, the origin (0, 0) will become the first sketcher point. The angle and point's coordinates are defined in a local coordinate system which origin is the last point of the sketch

Parameters
angle- angle in a plane
x- value on the axis Ox

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addSegmentAngleY()

def addSegmentAngleY (   self,
  angle,
  y 
)

Add one straight segment, defined by angle and intersect straight y= param y.

If the first point of sketcher is not yet defined, the origin (0, 0) will become the first sketcher point. The angle and point's coordinates are defined in a local coordinate system which origin is the last point of the sketch

Parameters
angle- angle in a plane
y- value on the axis Oy

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addSegmentPerpLength()

def addSegmentPerpLength (   self,
  length 
)

Add one straight segment, defined by perpendicular(angle=90) and length.

If the first point of sketcher is not yet defined, the origin (0, 0) will become the first sketcher point. The length coordinates are defined in a local coordinate system which origin is the last point of the sketch

Parameters
length- length of the segment

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addSegmentPerpX()

def addSegmentPerpX (   self,
  x 
)

Add one straight segment, defined by perpendicular(angle=90) and intersect straight x= param x.

If the first point of sketcher is not yet defined, the origin (0, 0) will become the first sketcher point. The point's coordinates are defined in a local coordinate system which origin is the last point of the sketch

Parameters
x- value on the axis Ox

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addSegmentPerpY()

def addSegmentPerpY (   self,
  y 
)

Add one straight segment, defined by perpendicular(angle=90) and intersect straight y= param y.

If the first point of sketcher is not yet defined, the origin (0, 0) will become the first sketcher point. The point's coordinates are defined in a local coordinate system which origin is the last point of the sketch

Parameters
y- value on the axis Oy

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addSegmentLength()

def addSegmentLength (   self,
  length 
)

Add one straight segment, defined by previous direction and length.

If the first point of sketcher is not yet defined, the origin (0, 0) will become the first sketcher point. The length coordinates are defined in a local coordinate system which origin is the last point of the sketch

Parameters
length- length of the segment

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addSegmentX()

def addSegmentX (   self,
  x 
)

Add one straight segment, defined by previous direction and intersect straight x= param x.

If the first point of sketcher is not yet defined, the origin (0, 0) will become the first sketcher point. The point's coordinates are defined in a local coordinate system which origin is the last point of the sketch

Parameters
x- value on the axis Ox

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addSegmentY()

def addSegmentY (   self,
  y 
)

Add one straight segment, defined by previous direction and intersect straight y= param y.

If the first point of sketcher is not yet defined, the origin (0, 0) will become the first sketcher point. The point's coordinates are defined in a local coordinate system which origin is the last point of the sketch

Parameters
y- value on the axis Oy

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addSegmentDirectionLength()

def addSegmentDirectionLength (   self,
  dx,
  dy,
  length 
)

Add one straight segment, defined by direction and length.

If the first point of sketcher is not yet defined, the origin (0, 0) will become the first sketcher point. The direction and length coordinates are defined in a local coordinate system which origin is the last point of the sketch

Parameters
dx,dy- direction of the segment
length- length of the segment

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addSegmentDirectionX()

def addSegmentDirectionX (   self,
  dx,
  dy,
  x 
)

Add one straight segment, defined by direction and intersect straight x= param x.

If the first point of sketcher is not yet defined, the origin (0, 0) will become the first sketcher point. The direction and point's coordinates are defined in a local coordinate system which origin is the last point of the sketch

Parameters
dx,dy- direction of the segment
x- value on the axis Ox

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addSegmentDirectionY()

def addSegmentDirectionY (   self,
  dx,
  dy,
  y 
)

Add one straight segment, defined by direction and intersect straight y= param y.

If the first point of sketcher is not yet defined, the origin (0, 0) will become the first sketcher point. The direction and point's coordinates are defined in a local coordinate system which origin is the last point of the sketch

Parameters
dx,dy- direction of the segment
y- value on the axis Oy

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addArcAbsolute()

def addArcAbsolute (   self,
  x,
  y 
)

Add arc, which connects the given point with previous point Coordinates are considered as absolute.

If the first point of sketcher is not yet defined, the origin (0, 0) will become the first sketcher point.

Parameters
x,y- Coordinates of second point of arc

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addArcRelative()

def addArcRelative (   self,
  dx,
  dy 
)

Add arc, which connects the given point with previous point Coordinates are considered relative to the previous point.

Parameters
dx,dy- Coordinates of second point of arc relative to the previous point

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addArcRadiusAbsolute()

def addArcRadiusAbsolute (   self,
  x,
  y,
  radius,
  flag 
)

Add arc, defined by radius and coordinates of next point.

Coordinates are considered as absolute. If the first point of sketcher is not yet defined, the origin (0, 0) will become the first sketcher point.

Parameters
x,y- Coordinates of second point of arc
radius- radius of arc
flag- is 0 or 2 if 0 the drawn arc is the one of lower angle (<Pi) if 2 the drawn arc is the one of greater angle (>Pi)

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addArcRadiusRelative()

def addArcRadiusRelative (   self,
  dx,
  dy,
  radius,
  flag 
)

Add arc, defined by radius and coordinates of next point.

Coordinates are considered relative to the previous point.

Parameters
dx,dy- Coordinates of second point of arc
radius- radius of arc
flag- is 0 or 2 if 0 the drawn arc is the one of lower angle (<Pi) if 2 the drawn arc is the one of greater angle (>Pi)

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addArcCenterAbsolute()

def addArcCenterAbsolute (   self,
  x,
  y,
  xc,
  yc,
  flag1,
  flag2 
)

Add arc, defined by coordinates of next point and coordinates of center.

Coordinates are considered as absolute. If the first point of sketcher is not yet defined, the origin (0, 0) will become the first sketcher point.

Parameters
x,y- Coordinates of second point of arc
xc,yc- Coordinates of center
flag1- (reverse) is 0 or 2 if 0 the drawn arc is the one of lower angle (<Pi) if 2 the drawn arc is the one of greater angle (>Pi)
flag2- (control tolerance) is 0 or 1 if 0 the specified end point can be at a distance of the arc

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addArcCenterRelative()

def addArcCenterRelative (   self,
  dx,
  dy,
  xc,
  yc,
  flag1,
  flag2 
)

Add arc, defined by coordinates of next point and coordinates of center.

Coordinates are considered relative to the previous point.

Parameters
dx,dy- Coordinates of second point of arc
xc,yc- Coordinates of center
flag1- (reverse) is 0 or 2 if 0 the drawn arc is the one of lower angle (<Pi) if 2 the drawn arc is the one of greater angle (>Pi)
flag2- (control tolerance) is 0 or 1 if 0 the specified end point can be at a distance of the arc

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addArcAngleRadiusLength()

def addArcAngleRadiusLength (   self,
  angle,
  radius,
  length 
)

Add arc, defined by angle, radius and length.

If the first point of sketcher is not yet defined, the origin (0, 0) will become the first sketcher point.

Parameters
angle- angle in a plane
radius- radius of the arc
length- length of the arc

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addArcPerpRadiusLength()

def addArcPerpRadiusLength (   self,
  radius,
  length 
)

Add arc, defined by perpendicular(angle=90), radius and length.

If the first point of sketcher is not yet defined, the origin (0, 0) will become the first sketcher point.

Parameters
radius- radius of the arc
length- length of the arc

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addArcRadiusLength()

def addArcRadiusLength (   self,
  radius,
  length 
)

Add arc, defined by previous direction, radius and length.

If the first point of sketcher is not yet defined, the origin (0, 0) will become the first sketcher point.

Parameters
radius- radius of the arc
length- length of the arc

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ addArcDirectionRadiusLength()

def addArcDirectionRadiusLength (   self,
  dx,
  dy,
  radius,
  length 
)

Add arc, defined by direction, radius and length.

If the first point of sketcher is not yet defined, the origin (0, 0) will become the first sketcher point.

Parameters
dx,dy- direction of the arc
radius- radius of the arc
length- length of the arc

References Sketcher3D.myCommand, Sketcher2D.myCommand, and gsketcher.printVar().

◆ close()

def close (   self)

Set to close the wire

References Sketcher2D.closed.

◆ wire()

def wire (   self,
  WorkingPlane = [0, 0, 0, 0, 0, 1, 1, 0, 0],
  theName = None 
)

Obtain the sketcher result as a wire.

Parameters
WorkingPlane- current Working Plane used for this 2DSketcher
theNameObject name; when specified, this parameter is used for result publication in the study. Otherwise, if automatic publication is switched on, default value is used for result name.
Returns
New GEOM_Object, containing the created wire

References Sketcher2D.closed, CheckConformity.geompyD, Sketcher3D.geompyD, Sketcher2D.geompyD, Polyline2D.geompyD, Sketcher3D.myCommand, Sketcher2D.myCommand, geomBuilder.ParseSketcherCommand(), and geomBuilder.RaiseIfFailed().

◆ face()

def face (   self,
  WorkingPlane = [0, 0, 0, 0, 0, 1, 1, 0, 0],
  theName = None 
)

Obtain the sketcher result as a face.

Parameters
WorkingPlane- current Working Plane used for this 2DSketcher
theNameObject name; when specified, this parameter is used for result publication in the study. Otherwise, if automatic publication is switched on, default value is used for result name.
Returns
New GEOM_Object, containing the created face

References Sketcher2D.closed, CheckConformity.geompyD, Sketcher3D.geompyD, Sketcher2D.geompyD, Polyline2D.geompyD, Sketcher3D.myCommand, Sketcher2D.myCommand, geomBuilder.ParseSketcherCommand(), and geomBuilder.RaiseIfFailed().

Field Documentation

◆ geompyD

geompyD

◆ myCommand

myCommand

◆ closed

closed