What is the simplest way to create a horizontal or vertical dashed 2D line in Blender?
-
1$\begingroup$ Could you please provide more info on what you are trying to do? $\endgroup$– Nate_Sycro27Commented Jan 29, 2020 at 11:45
-
$\begingroup$ @Nate_Sycro27 I want to put a dashed straight line on the one face of a cube. $\endgroup$– Mikhail NonoCommented Jan 29, 2020 at 11:55
-
2$\begingroup$ Related maybe blender.stackexchange.com/a/76111/15543 $\endgroup$– batFINGERCommented Jan 29, 2020 at 12:06
4 Answers
You can create a long cylinder.
Under Edit mode, insert several "loop cuts" to the side of the cylinder; with "face select" activated, you press "a" once or twice to select all faces.
Press "space" and write "checker deselect".
At this time, you have 2 options, assign a transparent material to these faces, or you just delete them (I would go for the transparent material, so you get a single object all connected).
-
1$\begingroup$ I just remembered another way. You do a small cylinder. Rotate it on the direction you want. Using the "array modifier", you have control on the spacing between cylinders (dashes) and the array length will be the length you need to your final line, $\endgroup$– MCunhaCommented Feb 29, 2020 at 16:26
(Following Mcunha comment, using Blender 3.6.1)
For a single body pattern (e.g., dashed line):
- Fig. 1: Create the pattern as a Bezier curve, setting its origin at one end. Use “Bevel“ to make it a cylinder.
- Fig. 2: Create the curve to populate with the pattern as a Bezier Curve. Projection along this curve is less unpredictable if the pattern and this curve share the same origin (see the note on this page: https://docs.blender.org/manual/en/3.6/modeling/modifiers/deform/curve.html). Make it a child of the pattern, just to keep things organized.
- Fig. 3: (1) Add to the pattern an Array modifier. Specify the curve to populate to set the repetition count, and adjust the gap with the “Relative Offset”. (2) Add to the pattern a Curve modifier specifying the curve to populate as the “Curve Object”, and try and test different values for the “Deform Axis”.
- Fig. 4: Adapt the final shape of the pattern using “Geometry/Extrude” and “Bevel/Depth” parameters.
For a multibody pattern (e.g., dot and dash line):
- Fig. 5: (1) Create each piece of the pattern as a Bezier curve. All should share the same origin to keep aspect ratio and relative position if scaled later. (2) Place an Empty where the next pattern should be.
- Fig. 6: Repeat the process described at Fig. 3 for each piece, using the Empty to specify the Offset. Every piece is deformed to follow the underlying curve.
- Fig. 7: For straight lines (see bottom curve), it is more convenient (1) to add a Plane to the pattern, (2) to make it the Parent of all the pieces, (3) to set Instancing on Faces, adjusting its visibility by toggling “Show Instancer”. Because instancing is applied after the Curve modifier, the pieces are not deformed to follow the underlying curve, yielding to misalignment for patterns long compared to the radius of curvature of the curve to populate (see top curve).
- Fig. 8: Examples. Counterintuitively for the circle, the pattern origin is next to the circle center, not to the starting point of the Bezier curve.
You can do this by using Blender's knife tool. In edit mode, select the knife tool, and LMB to start. Then drag the line to the opposite corner of the cube. LMB again, and then press 'enter'. You have a new diagonal line now on the cube.
-
3$\begingroup$ I need to draw a vertical or horizontal line. It should look like [ | ] or [-]. The line should consist of the small lines like "- - - - - - - -". $\endgroup$ Commented Jan 29, 2020 at 13:36