How draw lwpolyline?

(0, 0, 0, .05), (3, 0, .1, .2, -.5), (6, 0, .1, .05), (9, 0)

Given the above data, I would like to render it as shown below.
LWPolyline5

However, I encountered an issue with the thickness of the line, and it was more difficult to draw a line with a different thickness for each position.
I would like to ask for help on this.

lwpolyline?
Last time I’ve seen this word is when I worked with AutoCAD decades ago :slight_smile:

What are these numbers about? Any chance to show the code, that produces the picture provided?

1 Like

point format = (x, y, [start_width, [end_width, [bulge]]])
The format looks like this.

lwpolyline example
There is an example document that will be helpful.

Just out of curiousity, did you solve the processing of the bulge parameter, thus, you’re able to draw an arc with three.js with the given format of points?
And it would be nice to provide the code you use to draw straight lines.

1 Like

draw arc
I solved drawing an arc while reading this article.

Cool! What and how do you do to set lines’ width?

As for line thickness, I have done something like it in Suica (which is a wrapper over Three.js) – a tube which path is defined via a function (or a spline) … and radius that is also defined by a function (or a spline).

Demos:

1 Like

That bulge was real fun to make :sweat_smile:

Didn’t implement thickness yet.

1 Like

I could hardly imagine what will come next. Maybe bulge in a bulge?

3 Likes

Yeah, seems possible. The algo works :sweat_smile:

2 Likes

An option with fat lines (segments) :sweat:

1 Like

Hmm… I can’t say I’m satisfied with the result of fat lines.

Maybe bended planes will be better :thinking:

1 Like

I think it’s enough of experimenting :sweat_smile:
Curved planes:

1 Like

Wow what material did you make it with?

Non-modified MeshBasicMaterial.
All the lines is a single geometry of merged plane geometries.

1 Like

Line thickness is only 1px in webgl, right? How did you implement line weight?

They are not lines, they are narrow and long planes :slight_smile:

If you are drawing planes based on 3 lines, how did you handle the index?

Why does it have to be so? I just set heights for left side (start) and right side (end) of a plane geometry. There are always 4 points for a straight line.