-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ShapeGeometry: Adding lineTo manually closing a shape, this line gets ignore #9450
Comments
Related to LaserWeb/deprecated-LaserWeb3#56 (comment) |
Additional note: Using shape.autoclose DOES close the shape, but I do not think I need to rely on that, since our geometry is dynamically drawn, and some shapes will need to be closed, some wont, its easier to handle drawing the closing segment manually in the upstream code (just follow the SVG path). My parser already generates the closing line: and the code does the last lineTo. Why is it dropped? |
/ping @zz85 |
It works just fine. |
That "LINE" does not make any sense. |
The 'move to' exists because some svgs we import has multiple entities, so Agreed on the first line to, that can be removed. But removing it doesnt |
Ok, rereading your first comment, removing the Move to, seems to address the issue and the segment shows up. |
Now, I still dont understand WHY it fails with the move to. I do admit its 99.999% sure I am doing something wrong, I guess my question is - should I not be using move to (if not, how do I get a "not drawing a line" move to the start of the first path I want to draw? I can use another method - the moveto/lineto came from the threejs examples |
It doesn't fail. |
@openhardwarecoza You are not using three.js correctly. Copy the coding patterns in http://threejs.org/examples/webgl_geometry_shapes.html.
|
Aha, thanks Westlangley! More explained reply - much appreciated! (Adding a little theory helps a lot more in teaching) . I have been battling the ShapeGeometry thing for a few days now! So, taking your advice, triggered my thinking that of course, I only need lines! So.... Much better: https://jsfiddle.net/peter6960/e7tbg5fp/10/
Works perfectly now! |
@openhardwarecoza Please use |
Yeah, sorry, normally I would SO, but this looked like a bug based on what i thought lineto was supposed to do. (; I did ask MrDoob first in issue on my project (; Wont Happen Again |
@openhardwarecoza I saw that. No problem. : - ) |
Description of the problem
If I draw a rectangle (rectangle used for the simplied example, but holds true for any 2D geometry I tried. I always ignores the last segment) with
The result has a missing side:
Three.js version
Tested and happens with every version I tried
Browser
I only tested Chrome, but quite sure the others have same issue
OS
Hardware Requirements (graphics card, VR Device, ...)
Replicated issue in JSFidde:
Replicated here: https://jsfiddle.net/peter6960/e7tbg5fp/7/
The text was updated successfully, but these errors were encountered: