Version: 9.16.0
Home
Loading...
Searching...
No Matches

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

Public Member Functions

 __init__ (self, geompyD)
 
 addPoint (self, x, y)
 Add one point.
 
 addAngle (self, angle)
 Add angle.
 
 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.
 
 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.
 
 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.
 
 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.
 
 addSegmentAbsolute (self, x, y)
 Add segment, which sequentially connects the given point with previous point.
 
 addSegmentRelative (self, dx, dy)
 Add segment, which sequentially connects the given point with previous point Coordinates are considered relative to the previous point.
 
 addSegmentAngleLength (self, angle, length)
 Add one straight segment, defined by angle and length.
 
 addSegmentAngleX (self, angle, x)
 Add one straight segment, defined by angle and intersect straight x= param x.
 
 addSegmentAngleY (self, angle, y)
 Add one straight segment, defined by angle and intersect straight y= param y.
 
 addSegmentPerpLength (self, length)
 Add one straight segment, defined by perpendicular(angle=90) and length.
 
 addSegmentPerpX (self, x)
 Add one straight segment, defined by perpendicular(angle=90) and intersect straight x= param x.
 
 addSegmentPerpY (self, y)
 Add one straight segment, defined by perpendicular(angle=90) and intersect straight y= param y.
 
 addSegmentLength (self, length)
 Add one straight segment, defined by previous direction and length.
 
 addSegmentX (self, x)
 Add one straight segment, defined by previous direction and intersect straight x= param x.
 
 addSegmentY (self, y)
 Add one straight segment, defined by previous direction and intersect straight y= param y.
 
 addSegmentDirectionLength (self, dx, dy, length)
 Add one straight segment, defined by direction and length.
 
 addSegmentDirectionX (self, dx, dy, x)
 Add one straight segment, defined by direction and intersect straight x= param x.
 
 addSegmentDirectionY (self, dx, dy, y)
 Add one straight segment, defined by direction and intersect straight y= param y.
 
 addArcAbsolute (self, x, y)
 Add arc, which connects the given point with previous point Coordinates are considered as absolute.
 
 addArcRelative (self, dx, dy)
 Add arc, which connects the given point with previous point Coordinates are considered relative to the previous point.
 
 addArcRadiusAbsolute (self, x, y, radius, flag)
 Add arc, defined by radius and coordinates of next point.
 
 addArcRadiusRelative (self, dx, dy, radius, flag)
 Add arc, defined by radius and coordinates of next point.
 
 addArcCenterAbsolute (self, x, y, xc, yc, flag1, flag2)
 Add arc, defined by coordinates of next point and coordinates of center.
 
 addArcCenterRelative (self, dx, dy, xc, yc, flag1, flag2)
 Add arc, defined by coordinates of next point and coordinates of center.
 
 addArcAngleRadiusLength (self, angle, radius, length)
 Add arc, defined by angle, radius and length.
 
 addArcPerpRadiusLength (self, radius, length)
 Add arc, defined by perpendicular(angle=90), radius and length.
 
 addArcRadiusLength (self, radius, length)
 Add arc, defined by previous direction, radius and length.
 
 addArcDirectionRadiusLength (self, dx, dy, radius, length)
 Add arc, defined by direction, radius and length.
 
 close (self)
 Set to close the wire

 
 wire (self, WorkingPlane=[0, 0, 0, 0, 0, 1, 1, 0, 0], theName=None)
 Obtain the sketcher result as a wire.
 
 face (self, WorkingPlane=[0, 0, 0, 0, 0, 1, 1, 0, 0], theName=None)
 Obtain the sketcher result as a face.
 

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__()

__init__ (   self,
  geompyD 
)

Member Function Documentation

◆ addPoint()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

close (   self)

Set to close the wire

References Sketcher2D.closed.

◆ wire()

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, and Sketcher2D.myCommand.

◆ face()

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, and Sketcher2D.myCommand.

Field Documentation

◆ geompyD

geompyD

◆ myCommand

myCommand

◆ closed

closed