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. Straight Lines and Arrows

Straight Lines and Arrows

Scheduled Pinned Locked Moved 3D Blocks
1 Posts 1 Posters 1.0k 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

    • Cylinders and Tubes

     

    Introduction

    Lines and arrows are commonly used in charts and illustrations. You can think of a 3D line as a thin tube that connects between 2 points.

     

    The “Add Line” Block

    The “add line” block has quite a few inputs. You can use this block to add a solid line, an arrow, or a dotted line.

     
    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/6911bf36-a703-46e4-9a92-44ccf3b29f97.png" width="1000" style="filter: drop-shadow(0.35rem 0.35rem 0.4rem rgba(0, 0, 0, 0.5));">

     

    Color Selection

    You can set the initial diffusion color when you add a cylinder. You can update its diffusion/emission color, roughness or brightness later.

     

    Diameter

    The diameter controls how thick the line is.

     

    Cap Type

    The cap type controls whether the top and bottom faces of the line are covered up or open. For example, if the cap type is 'None", then you can see through the line like a tube.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/d2344aef-2e0a-483b-9d6a-9ca3ce7e10dd.gif" width="500" style="border-radius: 5px; border: 1px solid #29622d;">

     

    Arrow Type

    This input allows you to add arrowheads to the start or end point of the line, which converts the line into an arrow.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/fc2e98bf-30de-41d6-9944-f5eed71eedb7.gif" width="500" style="border-radius: 5px; border: 1px solid #29622d;">

     

    Sides

    Since lines are just long and thin tubes, you can set their “Sides” similar to tubes. The more sides you specify, the more “rounded” the line looks. Since typically lines are very thin, a small “Sides” value like 4 to 6 should be good enough.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/b09ed4e6-5ca1-4b07-a3f4-6cb5d7ca11b7.gif" width="500" style="border-radius: 5px; border: 1px solid #29622d;">

     

    XYZ Position of the “From” and “To” Points

    Since lines are used to connect between 2 points, you can specify the X/Y/Z positions of these 2 points directly.

    This is a very convenient feature. Suppose we need to add a line between the point (0, 0, 0) and (100, 100, 100). If you have to use a tube, then you have to move and rotate the tube to connect these 2 points. However, with the “add line” block, you can specify these 2 points as inputs.

     

    Segments: Segment Count for Dotted Lines

    You can use this block to add dotted lines as well, using the “segments” input. If it is left blank, then you get a solid line. But if you specify a number, then the solid line is cut into this many segments. Each segment will be half solid and half empty.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/9acb785d-acb9-4d8c-aead-9a5fe8077c0b.gif" width="500" style="border-radius: 5px; border: 1px solid #29622d;">

     

    The “Add Dotted Line” Block

    When you add a dotted line using the “add line” block above, the segments and the gaps between them are of the same length.

    If you need to make each segment longer or shorter relative to the gap between them, you can use the “add dotted line” block:

    85bbafee-dc60-4551-9513-00980f9afb4e-image.png

     
    Here are 2 dotted lines with different segment lengths and gap lengths:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/2782232a-b5e3-405a-8fd4-4f0846cd4b55.gif" width="500" style="border-radius: 5px; border: 1px solid #29622d;">

     

    Demo

    In this program, 12 white lines are used to form the frame of a box, and then 3 yellow dotted lines are drawn to connect 3 vertices into a triangle:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/1016ac50-a437-436f-88e7-f2049352298e.gif" width="500" style="border-radius: 5px; border: 1px solid #29622d;">

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/f6fb4e2f-353d-4354-8033-161120aab7f2.png" width="1000" style="">

    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