设置

Choose language

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

wave
.x1
.x2
.y1
.y2
.a1
.a2
.l
.dx
.dy
.p1
.p2

Function parameters


  • set of points in brackets
  • (optional) angle at the first point
  • (optional) angle at the second point
  • (optional) coefficient, 1 by default



  • If the name of a wave is not set in code, the default name is formed as W_firstpoint_lastpoint. E.g. an unnamed wave through points P1, P2, P3, P4, P5, P6 and P7 will get name W_P1_P7.

    Names of points can be substituted with function point(x,y) etc. 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 wave also has direction from first point to second point.

    Object properties


    After a wave 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 path
  • .p1 - the first point
  • .p2 - 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


    Angles can be omitted. In this case, the first angle will equal the angle from the first point of a wave to its second point, and the last angle will equal the angle between the last but one point and the last point.

    You can use mathematical equations, variables, and size constants in syntax, e.g.
    wave((p1,p2,p3),15,-45)
    w1=wave((point(10,70+sz3),point(p3.x,p4.y),p3),1+90,angle(p1,p2,p3)+[p1:p2].a1,1,2)


    By default the system will draw a set of waves that are 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 COEFFICIENT. You may set it from 0 (which degrades a curve to a straight line) to any number, but look out for intercrossing.
    wave((P1,P2,P3,P4,P5,P6,P7),270,180, 0.5)
    wave((P1,P2,P3,P4,P5,P6,P7),270,180, 1)
    wave((P1,P2,P3,P4,P5,P6,P7),270,180, 1.5)

  • 上一篇文章

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

    返回类别

    对象

    下一篇文章

    convex (point1,angle1,point2,angle2,radius)