Comments (3)
You're suggesting a concave polygon triangulated from the Spline, I presume.
With the freedom of the Spline, this would allow overlapping areas which, I think, would be expected to be non-filled.
When you also factor in the interpolated Splines, you get many points that would be used, resulting in very many triangles.
It seems that you mean to create a separate drawable object called Polygon that would store triangles but can be created from a Spline's current points. I'm not sure which approach would be better: separating the Polygon from the Spline or just adding "fill" flag to Spline and switching its calculation over to triangulation.
I will, either way, look into triangulation to make sure I can implement this in a relatively simple way.
from selbaward.
You're suggesting a concave polygon triangulated from the Spline, I presume.
Yes.
With the freedom of the Spline, this would allow overlapping areas which, I think, would be expected to be non-filled.
Do you mean that the [larger] Polygon could have holes? that would be great of course.
It seems that you mean to create a separate drawable object called Polygon that would store triangles but can be created from a Spline's current points.
Yes to the latter, if that requires triangles, yes.
I'm not sure which approach would be better: separating the Polygon from the Spline or just adding "fill" flag to Spline and switching its calculation over to triangulation.
In a way the sw::Spline is (just) a special kind of (sw::)Polygon, one with transparent fill. There will obviously be much overlap (all the stuff related to the outline), so my vote would be to "marry" the two. Then sw::Spline could become just a [specialized] typedef of sw::Polygon, as not to break existing code or require people to change their code-base.
I will, either way, look into triangulation to make sure I can implement this in a relatively simple way.
Great, I think this can be very useful and eventually should be put up for inclusion in SFML, as this class will be just another square, circle etc. From the whole SW collection, this one stands out as being close to existing functionality. Thanks for looking into this.
from selbaward.
Hi again.
I would like to just mention that Polygon has now been added to Selba Ward.
It is still in its early phase (currently at v1.1) but can currently triangulate a given set of points as long as there are no overlaps and the points are given in an anti-clockwise direction.
Future plans for this include:
- allowing points in clockwise direction with a 'clockwise flag',
- automatically detecting direction of points,
- other triangulation methods,
- triangulation refinements (e.g. post-processing),
- allowing holes.
Note that it is not directly connected to Spline and just takes all of the points' positions and creates a polygon from that. Of course, you can get all of Spline's points' positions manually but the next version of Spline will include a simple way to 'export' all of those positions at once (and will be compatible with the 'dump' style method of Polygon that takes all points at once).
So, I shall now consider this issue complete (i.e. fixed) although feel free to open others for separate issues or others regarding Polygon/Spline.
Fixed in commit 3a65737
from selbaward.
Related Issues (20)
- Console Screen - Colour commands don't work properly in printStretchedAt()
- Wiki - Spline doesn't compile with versions of SFML below v2.4 HOT 10
- m_thickness not initialized in Spline class
- NinePatch does not combine its transform with the RenderStates transform HOT 4
- ProgressBar HOT 7
- BitmapText does not check if internal font handle is null HOT 1
- Some missing explicit inclusions and namespaces
- Initialization Order. HOT 10
- (ElasticSprite) Texture cut off when perspective interpolation enabled HOT 5
- Spline closes incorrectly with certain corner types HOT 1
- Spline should limit corner point length HOT 1
- Thank you for this I dont know who to contact HOT 2
- Error LNK2019 HOT 2
- The purpose of subdivision in Sprite3D HOT 1
- Unable to make a rotating cube HOT 11
- Ring shape - incorrect size HOT 3
- Question: plans to port to SFML 3? HOT 7
- Remove Old Version of Console Screen HOT 1
- Continuous Integration Error Output HOT 14
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 selbaward.