Figma: Can't draw a straight line using Pen and pencil tool what to do now - figma

When I'm trying to draw a line it always shows me to BEND the line. How to draw a straight line in FIGMA using PEN Tool ?
I was expecting the correct answer

Related

Is there a way to paint every second pixel in photoshop? (For dithering)

I'm asking this question with regards to drawing pixel art. If I want to draw a line for example, I can just click on one pixel with my pencil tool, hold shift and click where I want the line to end. I was wondering if there was some way to do the same, but only paint every other pixel so I don't have to paint every other pixel individually whenever I want to achieve the dithering effect. This is especially annoying when I'm doing a long line.
Thanks for you help!
Start with a new layer,then Draw a line you want
and click "ctr + J", You can create new copy of the same line.

Cannot draw on the Oz dimension (Tried OSNAP)

I'm a beginner learning to draw with Autocad 2018. But drawing a house, I can't draw a door, a rectangle going up in Oz dimension. It's only allowed to draw in Oxy.
I tried turn on and off OSNAP (F3) but it did not work out.
Also I can't just draw a rectangle that starts from a line, it needs to be 2 lines.
Any help is appreciated. Thank you for your time.
I figured out:
You have to activate an option named "3d object snap". It's in the menu bar (bottom, farest to the right).

Draw rounded thick line with WebGL & Three.js

I just started to fiddle around with WebGL and three.js.
I would really like to create a thick line, which has rounded corners and endings. (see example picture)
Unfortunately I see that firstly the LineBasicMaterial's linecap property does not really work.
Three.js LineBasicMaterial
I started to think about using a tube, but then I think I will still not get a round cap...
Does someone have any ideas how I could create a line in the picture above? It does not necessarily have to made with three.js but WebGL would be a requirement. (I also want to animate this line further on...)
Thanks for any hints.
Cheers
There are a couple ways to draw 3d volumetric lines. The first is to do a vertex expansion in the shader. This is what the links in the comments do. Here is another one in case you need more material: http://codeflow.org/entries/2012/aug/05/webgl-rendering-of-solid-trails/.
Unfortunately it have visual artifacts when the line segment is viewed directly heads on. Check out the demo here: http://codeflow.org/webgl/trails/www/. Spin the scene around and you will notice some line segments facing directly towards the camera will spin rapidly. It looks a lot worse with a less noisy texture btw. If this is fine with you this is probably the preferred option.
The 2nd option is to just dynamically generate a capsule mesh for each line segment. Not much to say about it, beyond that this is a simple, abet somewhat inefficient method.
The 3rd option is to do a limited kind of ray tracing in the shader. Calculate the distance between the line segment and the fragment being shaded and we can use that to determine the appropriate color. Here is a link for that. Geometry shader is not currently supported in the webgl but there is nothing stopping you from generating the bounding line cuboid via javascript. Oh and if you need soft lines you probably need the blend_minmax extension. Probably the hardest method to setup but can be viewed at any angle and very customize-able compared to the other 2 methods.

Drawing varying line widths with NSBezierPath?

I would like to create a vector object that can be drawn with a pen tablet and will honor the pressure information from the pen (by increasing/decreasing line width appropriately). Now I know how to get the pressure info out of the NSEvent, but of course NSBezierPath doesn't support varying line widths.
So I'm trying to generate a Bezier path that is the outline of my line, by calculating the perpendicular lines at the ends of the curve and connecting those with the very same curve. It nearly works in my little test project for a single curve segment:
https://github.com/uliwitness/WideningBezierPathTest
but this has one big issue: The line thins to barely 2 pixels in the middle (it should only go from 32 to 8). Does anyone know how I'd adjust the control points so the two edges of the line in the curved part are at roughly the same distance ?
Anyone have ideas? Suggestions? Useful articles?
Thanks to suggestions from others I've managed to cobble something together that works. I've committed the changes to the repository, but you can go back a few revisions if you want to see the older code. Here's what I do now:
I flatten the path using bezierPathByFlatteningPath. This gives me straight line segments.
I then calculate the start and end points of the perpendicular lines at the start and end of each line segment (these lines are as long as the line size should be at this point).
I create a bezier path containing a parallelogram consisting of the two perpendicular lines plus lines connecting them. This gives a smooth transition in line widths for each segment.
Once I have the segments, I draw the ending perpendicular lines of the path, plus the sides of each segment (but not the perpendicular lines between segments) into a new bezier path, which I can then fill to draw the stroke with the desired line width variations.
If you want to use this for printing or under HiDPI, you might have to muck with the "flatness" of the bezier path, but for 1x screen display it looks fine.

How To Draw a circle using using CxImage in VC++

I have loaded and displayed an image using CxImage functionality. now i need to draw some default shapes like circles and rectangles and lines. There is no defined function in CxImage for these only Line function is available. With that have i drawn rectangle. But no idea on how to draw circle.
if not possible using CxImage then what are the other ways and how this can be made with CxImage complaint(ie: I dont want to rewrite my functions for Save, New, Load Etc).
To draw circle, you can have a look on Bresenham Circle Algorithm. Start with Wikipedia http://en.wikipedia.org/wiki/Midpoint_circle_algorithm, you will find nice simple C implementation and an optimized version. Adaptation to CxImage is straightforward.

Resources