Settings

Choose language

curve (point1,point2,angle1,angle2,coefficient1,coefficient2)

curve
.x1
.x2
.y1
.y2
.a1
.a2
.l
.dx
.dy
.p1
.p2
.c1
.c2

Function parameters


  • first point of a curve
  • second point of a curve
  • angle at the first point
  • angle at the second point
  • (optional) first coefficient, 1 by default
  • (optional) second coefficient, 1 by default



    If the name of a curve is not set in code, the default name is formed as C_firstpoint_secondpoint. E.g. an unnamed curve between points P1 and P2 will get name C_P1_P2.

    Names of points can be substituted with function point(x,y). In this case it is mandatory to specify the name of the future arc, as there are no point names to create it automatically (second line of code).

    A curve also has direction from first point to second point.

    Object properties


    After a curve is created, you can get its properties by using the following syntax:
  • .a1 - angle at the first point with the horizontal
  • .a2 - the angle at the second point with the horizontal
  • .l - the length of the curve
  • .p1 - the first point
  • .p2 - the second point
  • .c1 - coefficient at the first point
  • .c2 - coefficient at the second point
  • .x1 - x coordinate for the first point
  • .y1 - y coordinate for the first point
  • .x2 - x coordinate for the second point
  • .y2 - y coordinate for the second point
  • .dx - difference of x coordinate values between the first and the second points
  • .dy - difference of y coordinate values between the first and the second point

    Usage


    You can use mathematical equations, variables, and size constants in syntax, e.g.
    curve(p1,p2,15,-45)
    c1=curve(point(10,70+sz3),point(p3.x,p4.y),1+90,angle(p1,p2,p3)+[p1:p2].a1,1,2)
    While the first four parameters of the curve function (points and angles) are straightforward, the coefficients might be less so.

    By default the system will draw a curve that is similar to a French curve, often used in pattern making. However if you would like the curve to be more or less shaped, you can play with the FIRST COEFFICIENT. When used alone without the second coefficient, it will determine how shaped the curve is in general. You may set it from 0 (which degrades a curve to a straight line) to any number, but look out for intercrossing.
    curve(p1,p2,-30,180+50)curve(p1,p2,-30,180+50,0)curve(p1,p2,-30,180+50,0.5)
    curve(p1,p2,-30,180+50,2)curve(p1,p2,-30,180+50,3)curve(p1,p2,-30,180+50,4.5)

    If you would like the curve to be unbalanced, more shaped at one edge and less shaped at the other, you may define this by using BOTH COEFFICIENTS.

    You can see how the two control points become closer or farther from points in the following examples:
    curve(p1,p2,-30,180+50,0.5,1)curve(p1,p2,-30,180+50,3,1)curve(p1,p2,-30,180+50,1,0.2)


  • Previous article

    arc(point1,point2,angle1,angle2)

    Next article

    wave ((point1,point2,...,pointn),angle1,angle2,coefficient)