def test_arc_by_coords(self):
arc = self.sketch.addArc(0, 1, 0, 0, 1, 1)
model.do()
- self.assertEqual(arc.startPointData().x(), 0)
- self.assertEqual(arc.startPointData().y(), 0)
+ self.assertEqual(arc.startPoint().x(), 0)
+ self.assertEqual(arc.startPoint().y(), 0)
def test_arc_by_points(self):
center = geom.Pnt2d(0, 1)
end = geom.Pnt2d(1, 1)
arc = self.sketch.addArc(center, start, end)
model.do()
- self.assertEqual(arc.startPointData().x(), 0)
- self.assertEqual(arc.startPointData().y(), 0)
+ self.assertEqual(arc.startPoint().x(), 0)
+ self.assertEqual(arc.startPoint().y(), 0)
def test_number_of_args(self):
with self.assertRaises(WrongNumberOfArguments):
arc.setStartPoint(-1.0, 0)
arc.setEndPoint(0, 1.0)
model.do()
- self.assertEqual(arc.centerData().x(), 0)
- self.assertEqual(arc.centerData().y(), 0)
- self.assertEqual(arc.startPointData().x(), -1)
- self.assertEqual(arc.startPointData().y(), 0)
- self.assertEqual(arc.endPointData().x(), 0)
- self.assertEqual(arc.endPointData().y(), 1)
+ self.assertEqual(arc.center().x(), 0)
+ self.assertEqual(arc.center().y(), 0)
+ self.assertEqual(arc.startPoint().x(), -1)
+ self.assertEqual(arc.startPoint().y(), 0)
+ self.assertEqual(arc.endPoint().x(), 0)
+ self.assertEqual(arc.endPoint().y(), 1)
if __name__ == "__main__":
self.line = self.sketch.addLine(0, 0, 0, 1)
self.arc = self.sketch.addArc(0, 1, 0, 0, 1, 1)
self.sketch.setCoincident(
- self.line.endPointData(), self.arc.startPointData()
+ self.line.endPointData(), self.arc.startPoint()
)
def test_set_tangent(self):
)
self.execute()
- ########
- #
- # Set methods
- #
- ########
-
- def setCenter(self, x, y):
- """Set arc center."""
- self._center.setValue(x, y)
- def setStartPoint(self, x, y):
- """Set start point."""
- self._start_point.setValue(x, y)
-
- def setEndPoint(self, x, y):
- """Set end point value."""
- self._end_point.setValue(x, y)
-
-
########
#
# Getters
########
- def centerData(self):
- """Return the center point data."""
+ def center(self):
+ """Return the center point."""
return self._center
- def startPointData(self):
- """Return the start point data."""
+ def startPoint(self):
+ """Return the start point."""
return self._start_point
- def endPointData(self):
- """Return the end point data."""
+ def endPoint(self):
+ """Return the end point."""
return self._end_point
def result(self):
"""Return the arc circular line attribute."""
return self._feature.lastResult()
+
+
+ ########
+ #
+ # Set methods
+ #
+ ########
+
+ def setCenter(self, x, y):
+ """Set arc center."""
+ self._center.setValue(x, y)
+
+ def setStartPoint(self, x, y):
+ """Set start point."""
+ self._start_point.setValue(x, y)
+
+ def setEndPoint(self, x, y):
+ """Set end point value."""
+ self._end_point.setValue(x, y)
########