Comments (10)
Please share some code with me that allows me to reproduce this error.
from graphics-smooth.
OMG how! please demo
from graphics-smooth.
@ivanpopelyshev Today a non-polygon hole in a polygon shape was giving me the same error. I tracked that down to the fact that the holes use the line command of the shape instead of the one matching its type. Fixed that. But then I noticed why it failed so terribly: because data.closeStroke
was false. Then I tried to draw non-closed polygons: those are not rendering at all. Something goes wrong in PolyBuilder#line
if closeStroke
is false.
let p = new PIXI.Polygon([0, 0, 100, 0, 100, 100, 0, 100]);
p.closeStroke = false;
let g = app.stage.addChild(new PIXI.smooth.SmoothGraphics()
.lineStyle(1)
.beginFill(0xffffff)
.drawPolygon(p)
.endFill());
from graphics-smooth.
Oh, interesting
from graphics-smooth.
@ivanpopelyshev I figured out why this error happens and fixed it with a19cda7: joint
should be endJoint
. The code produced a FILL joint, because it increased a NONE joint by one if closeStroke
was false; therefore hasTriangle
became true in the segment packer, which corrupted index buffer.
But after changing joint
to endJoint
there is still something wrong with the MITER joint:
I'm not quite sure what exactly is happening here in this part of the code. If I comment it out, the line is rendered correctly.
graphics-smooth/src/shapes/PolyBuilder.ts
Lines 284 to 297 in a19cda7
from graphics-smooth.
@ivanpopelyshev I'm considering to remove this code entirely:
graphics-smooth/src/shapes/PolyBuilder.ts
Lines 260 to 305 in 994fb4d
It seems to work fine without it, and it is flawed, but I'm not so sure exactly what it is supposed to do. Do you think it's safe to delete this code?
from graphics-smooth.
Oh, hi! Thanks for checking up on me.
Yes, its one of things i coded in beginning that i didnt fix yet. You can remove it if you test degenerate cases like "line goes there and back"
UPD: i think it was idea like "if bevel is good enough, use good miter instead, without a joint". It shouldnt affect things because we already are using instancing, right? or did i forget to enable it here?
from graphics-smooth.
The degenerate test in the examples looks good if I remove this part of the code. I tried all join and cap combinations. Then I can proceed to remove it?
I'm not very familiar with this joint stuff yet. MITER + 3
is higher quality? But this looked odd to me:
verts[JOINT_TYPE.JOINT_MITER] = 4 + 5;
verts[JOINT_TYPE.JOINT_MITER + 1] = 4 + 5;
verts[JOINT_TYPE.JOINT_MITER + 2] = 4;
verts[JOINT_TYPE.JOINT_MITER + 3] = 4;
+2 and +3 have less vertices. This the only joint type that has different vertex counts.
from graphics-smooth.
Yes, it was there to save vertices. I agree to remove it because , whether instancing is implemented or not - it will make this "optimization" worseless soon
from graphics-smooth.
Fixed in 0.0.26.
from graphics-smooth.
Related Issues (20)
- Is there a plan to support batching of multiple graphics elements? HOT 4
- The graph is scaled and the actual graph width remains the same HOT 2
- BeginHole PIXI. Smooth. SmoothGraphics whether can support HOT 1
- Draw arcs, arcs are not smooth, please confirm whether you can support arcs to be more smooth HOT 2
- Draw a circle, the circle is not smooth, please confirm whether the circle can be more smooth HOT 1
- When the image scale is reduced by 20 times, the green RGB(0,255,0) changes to the dark green RGB(0,76,0). HOT 1
- After using Graphic to draw graphics, you can directly use graphic.pluginname to change the color without redrawing. With SmoothGraphics, you can't change the color directly HOT 1
- SmoothGraphics is used to draw a circle, which is composed of many points. The circle is not smooth after being magnified, and the amount of data is very large. HOT 1
- Setting graphic.interactive = true, gives errors HOT 10
- Support Pixi 7 HOT 2
- Using graphics-smooth with pixi-legacy 6.5 with typescript won't build HOT 2
- This plugin does not appear to support pixi devtool HOT 3
- Is this available in a CDN? HOT 2
- OMG This is AMAZING. Game Changing. Is it possible to Beazer some parts of the line. HOT 3
- A couple questions about the implementation of smooth scrolling and quadraticCurveTo HOT 2
- `utils.premultiplyTint` deprecated HOT 1
- Mask support HOT 1
- Colour bleed from underneath lineStyle border HOT 1
- Type error for SmoothGraphics in renderer.generateTexture
- Will this be for version 8 pixi as of v8.0.0-beta.6 it is not working HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphics-smooth.