Comments (4)
That only gives back the first two points, that make up the first line. I could loop over the lines and pick out the right ends, but there is probably a more direct / faster way.
from geometrybasics.jl.
Yeah I am slowly realizing that the inherent geometrybasics methods like that I have used above don't quite support our use case(Makie).
I could loop over the lines and pick out the right ends, but there is probably a more direct / faster way.
I am trying to do a similar thing in the above referenced PR.
Here's something I tried as per the above PR.
using BenchmarkTools
pts = collect(Point{2, Float64}(x/2, (x+1)/3) for x in 1:10000)
ls = LineString(pts)
@btime ls.points.parent.data
128.521 ns (6 allocations: 192 bytes)
10000-element Array{Point{2,Float64},1}:
from geometrybasics.jl.
This can be closed now that #73 is merged?
from geometrybasics.jl.
I think this is more like a nested structure. Where we can't get to the point directly, but something like this works :
pts = Point{2, Int}[(3, 1), (4, 4), (2, 4), (1, 2), (3, 1)]
pol = Polygon(pts)
ngon = decompose(GB.Ngon, pol.exterior)
coordinates(ngon[1])
Also some nested decomposition works,
ngon = decompose(GB.Ngon, pol.exterior)
point = decompose(Point, ngon[1])
The stacktrace kinda hinted it,
Stacktrace:
[1] (::GeometryBasics.var"#152#153"{Int64,GeometryBasics.Ngon{2,Int64,2,Point{2,Int64}},Int64})(::Int64) at C:\Users\visser_mn.julia\dev\GeometryBasics\src\geometry_primitives.jl:57
Also like you said here,
Because this seems a bit inconsistent at times, as we saw above coordinates(::Polygon) returns lines, but if we put in an Ngon, a fixed size polygon, then we get the points:
from geometrybasics.jl.
Related Issues (20)
- Intersections of lines with Int parameters crash
- Slicing from previous GeometryTypes HOT 5
- Replicate named access with .{x,y,z,w} from StaticArrays https://github.com/JuliaArrays/StaticArrays.jl/pull/980
- Meshing a single triangle sometimes returns an empty mesh HOT 2
- Trying to plot basic geometry but decompose ordering not helping... HOT 2
- Documentation: Point not documented
- Nonlinear (Curved) Meshes
- `union` with negative width rectangles gives wrong result
- Bug in Line Intersection ( GeometryBasics.intersects ) HOT 12
- broken GeoInterface.convert(GeometryBasics.MultiPolygon) HOT 2
- Polygon constructor adds an interior by default, rather than an exterior as the docs say. HOT 3
- Error with empty metadata
- Would you allow ` HyperSphere(radius::Real, D::Int)` ? HOT 2
- FaceView Documentation, MethodError: no method matching FaceView(::Vector{Point{3, Float32}}, ::Vector{TriangleFace}) HOT 1
- Warnings after fresh compilation with julia 1.10 HOT 1
- Documentation is nonexistent HOT 3
- GeometryBasics.Mesh incorrectly converts quads to triangles HOT 2
- Construction from SVector is ambiguous HOT 1
- Adding NgonFace like types for volumetric elements (e.g. polyhedra) HOT 6
- Point2 in Polygon gives bad result. HOT 1
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 geometrybasics.jl.