Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • CreatiCode
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

CreatiCode Scratch Forum

  1. CreatiCode Forum
  2. Knowledge Base
  3. 3D Blocks
  4. Curved Lines and Arrows

Curved Lines and Arrows

Scheduled Pinned Locked Moved 3D Blocks
1 Posts 1 Posters 1.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • CreatiCodeI Offline
    CreatiCodeI Offline
    CreatiCode
    wrote on last edited by admin
    #1

     

    Prerequisite

    • Straight Lines and Arrows

     

    Introduction

    You already know lines are made of thin tubes in the CreatiCode playground. You can make curved lines using many small segments of tubes as well.

    To add a curve, you need to take 3 steps:

    1. Create a new list
    2. Generate a list of points
    3. Use this list to draw a curve

     

    Generate a List of Points for an Arc

    We only need 3 points to define an arc (a portion of a ring). Therefore, you can use the following block to generate a list of points along the arc.

     
    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/87935f62-2c1b-40e2-bbd4-fd81aa0c1cc0.png" width="1000" style="">

    Starting/Middle/End Points

    These 3 points define an arc in 3D space, and more points are inserted along this arc to make it smoother. Note that the “Middle Point” does not have to be exactly at the center of the arc. However, if you only specify 2 points (start and end), there can be many arcs going through them. For example, this image shows 4 arcs going through the green and blue points, each with a different middle point in yellow:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/e56d2744-f890-41ce-a691-0f09dcadb3fc.gif" width="480" style="border-radius: 5px; border: 1px solid #29622d;">

    List to Store the Points

    You need to select which list to use to store the points to be generated. If there is no list in the project, you need to create one first.

    Point Count

    This number specifies the desired number of points to be added along the arc. The higher the value, the more points will be inserted, which will make the curve smoother. Note that due to some optimizations, the actual number of points generated may be less than this input value.

     

    Add Curve Using the List of Points

    After the list of points is generated, we can draw a curve along these points using the “add curve” block:

     
    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/761da274-91fc-40d8-916d-9a784fca3ab6.png" width="1000" style="">

    First 5 Inputs

    The first 5 inputs are the same as those for adding straight lines, because they are used to control how the tube itself looks.

    List of Points

    The name of the list that contains the points to be used for the curve

    Start and End Index of List

    You do not have to use all the points in the list, instead, you can specify a starting index and an end index in the list. For example, if starting index is 1 and the end index is left empty (or the length of the list), then all points in the list will be used. However, if the starting index is 2 and the end index is 4, then only these 3 points will be used to draw the curve with.

    Segment Count

    This is the same as the solid line input, which cuts the curve into many line segments with gaps.

     

    Demo

    In this program, we add many curves, and rotate them to a different angle around the circle.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/1fd3d65b-0264-4e42-bbfd-569d8c46fe17.png" width="1000" style="">

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/e0db4de9-843c-4db8-8814-32e67a04100e.gif" width="460" style="border-radius: 5px; border: 1px solid #29622d;">

    1 Reply Last reply
    0
    • CreatiCodeI CreatiCode pinned this topic on

    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

    With your input, this post could be even better 💗

    Register Login
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode