Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorMonsen
    • CommentTimeJul 10th 2017 edited
     

    Index


    CC3+ contains a huge amount of various commands and features. In this series, I plan to highlight some of these. There won't be any special progression to this series, and the command will be selected from the entire range, from the simple basic commands, to more advanced features intended for the more advanced users. Feel free to use this topic to discuss the command presented. If you have a command you wish to have showcased, feel free to request it, and it may get presented.
    This series is called the command of the week, but it could also explain a feature or effect. The explanations will tend to explain the technical parts of the command, and is intended to highlight the basics (and complexities) of the command, but won't be a detailed tutorial on how to use it. It is up to you to use it creatively in your maps.

    Week 27 - Curves

    Most people will be familiar with the smooth path (and smooth polygon) which is probably the most used curve in CC3+. But there are other options.
    One of the great things about curves in CC3+ is that they are based on mathematical formulas. The advantage of this is that they retain their smooth shape no matter how much you zoom in on them, they will never break down into straight segments, nor will they be pixelated*.

    * Note that because a computer display is built up from a grid of pixels, everything which is not strictly horizontal or vertical will appear pixelated when rendered on screen. Anti-aliasing can help mitigate this, but CC3+ doesn't apply anti-aliasing to the image rendered on screen. Do note that since this pixelation is a limitation of your screen and not the actual line, it will ot increase as you zoom in to the line, as opposed to a line in a raster editor, where the pixels would be more and more pronounced as you zoom in. You can apply a weak blur to the line, this will have the same effect as anti-aliasing. In this case, I recommend using a blur size expressed in percentage of view width, thereby having the same size of the blur no matter your zoom level. Also note that when you render the CC3+ map out to an image, that image will be a regular raster image, without any of the nice features the curve has in CC3+, like unlimited pixel-free zooming

    Where to find them?

    Toolbar: (right click) t1.png, (right click) t2.png, (right click) t3.png, (right click) t4.png
    Menu: Draw -> Path, Draw -> Arc, Draw Polygon, Draw -> Circle
    Command Line: PATHD, ARCD, POLYD, SPLINE, SPLINE2, PSPLINE, BEZ, ARCB, ARC3, ARCS, ARCR, CARCD, ARCW, ELIPA, CIRP, CIRR, CIRD, CIR2, CIR3, DONUT, ELIPP

    How to use them

    The interesting parts of a curve is how it is drawn on screen depending on the nodes you place. Beginners may get a bit frustrated, because it seems like the smooth polygon never covers the area you specify. Truth be told, smooth entities can be a bit tricky, but knowing how they work certainly help. Let us discuss the various basic options we have.

    Curve aids

    The best aid to use when working with curves is frames (Tools -> Drawing Aids -> Toggle Frames). Frames shows a thin line between the nodes, which helps to pinpoint the exact positions of these. Frames typically manifests like a straight "border" around our smooth entity. For all my screenshots below, I have turned frames on.

    Paths vs Polygons

    A polygon is basically just a closed path. The behavior when it comes to smoothing is basically the same, so I'll be talking most about paths here, as to avoid repeating myself. The main difference is that a polygon doesn't have any special start/end points, all nodes are treated as middle nodes.

    spline.png

    Cubic curve

    When you use the default smooth path or smooth polygons in CC3+, you are using a cubic curve. This is characterized by touching the start and end point, but for all other points, the position of the line is averaged between the points. What this means in practice is that when you place a point, the shape of that segment of the path isn't determined until you place the next point, because it needs to average the position between these. Note that with a cubic curve, the line itself will never touch any nodes except the first and last node. You can however make a sharp corner in a specific place by placing two nodes on top of each other in that point. You can see that point in my example to the left at the sharp turn where the frame actually meets the bend of the line.
    You can check if a line uses cubic curves by using list on it and check if it's smoothing method property is Cubic B-Spline


    parabolic.png

    Parabolic Curve

    A path using parabolic smoothing will touch all the nodes. The path itself is drawn the same way as a cubic curve, but the result typically results in sharper angles. Just as with the cubic smoothing, the exact shape of a segment is only determined when you place the next node in the chain, since the smoothing computation depends on it. It is also worth nothing that you cannot use double node trick to get sharp corners with parabolic smoothing, as can clearly be seen in the example image to the left. However, this is less needed with parabolic curves anyway, since the curve touches the nodes anyway.
    You can check if a line uses parabolic smoothing if the smoothing method property is Parabolic Spline.


    bezier.png

    Bezier Curve

    A bezier curve in CC3+ consists of four nodes. The first two placed are the start and end nodes, while the third and fourth modifies the shape of the curve. Node that it can never have more than these four points, so a bezier curve cannot be used for a longer path, nor can it be closed to make a polygon. Forthe mathematics behind a bezier curve, check out this wikipedia article.
    You can check if a line uses bezier smoothing if the smoothing method property is Cubic Bezier.


    arc.png

    Arcs

    An arc is defined as a segment of the circumference of a circle. As such, an arc will always have the shape of a partial circle. However, the curvature is determined by the radius of the circle, so while the shape is fixed, adjusting the radius of the circle and the length of the segment provides a lot of flexibility in the appearance. The example image to the left shows different variations of arcs. Note that an arc is not a path. If you ever need to treat it like a path, you can convert it by using Line to Path [LTP2] on it. This will convert it to a regular path. You can then proceed to make it smooth by using Straight to Smooth [STC] on it, and it should appear very similar to the original arc entity.
  1.  
    Thanks for this. Do you know if you can control the spline tangency at the start or end point of a B-Spline or Parabolic Spline? If so, how would you do this?

    (The closest I can come to doing this is to place a second point near the end point.)

    Also of interest, how does the spline behave when trimmed? Does trim calculate a new end point and then the spline is recalculated based onthe points or is the path/trace of the spline remain the same (by keeping the values of the truncated point(s) for calculations and just stopping the display part of the curve at the appropriate point)?
    •  
      CommentAuthorMonsen
    • CommentTimeJul 10th 2017
     
    Posted By: LordEntrailsDo you know if you can control the spline tangency at the start or end point of a B-Spline or Parabolic Spline? If so, how would you do this?

    (The closest I can come to doing this is to place a second point near the end point.)
    As far as I know, placing an additional point is the only way.


    Posted By: LordEntrailsAlso of interest, how does the spline behave when trimmed? Does trim calculate a new end point and then the spline is recalculated based on the points or is the path/trace of the spline remain the same (by keeping the values of the truncated point(s) for calculations and just stopping the display part of the curve at the appropriate point)?
    The entity keeps all it's nodes, it just stops displaying at the point you trimmed it. Note that CC3+ still sees this as a valid endpoint, for example to use with the endpoint modifier.
    If you use LIST on it, you can see two parameters, start parameter and end parameter. This basically tells which range of nodes to include in the display (decimal values are relative distance along the line between the nodes)