Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    Straight Lines and Arrows

    3D Blocks
    1
    1
    340
    Loading More Posts
    • 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.
    • info-creaticode
      CreatiCode last edited by admin

       

      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.

       

       

      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.

       

      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.

       

      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.

       

      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.

       

      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:

       

      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:

      1 Reply Last reply Reply Quote 0
      • Pinned by  info-creaticode info-creaticode 
      • First post
        Last post