Comments (10)
👍 Sounds like a good idea.
Maybe we can minimize the disruption of renaming the package by using two repositories for a release cycle. We can go ahead and create the Contours.jl
package now, and make the current module throw out warnings when it is loaded.
from contour.jl.
In GeometryTypes
we started using the decompose
function for these kind of tasks.
Maybe we should rename it to collect
at some point, but it works in the following way:
points = decompose(Point, contour) # returns point coordinates of the line
lines = decompose(LineSegment, contour) # returns line segments
line = decompose(Line, contour) # returns a contigeous line
points = decompose(Point{3, Float32}, contour) # since we use types, we can also query types explicitely
points = decompose(Point{2, Float64}, contour) # return 2D points with Float64.
# this works for arbitrary geometry types as well:
points = decompose(Point, Pyramid(...))
This interface allows much flexibility while keeping the implementation very terse.
It helps in plotting environments, were you already know what kind of data you need, independant of the kind of data you actually have (e.g. you have Contour{Float64}
, but for plotting you know that you always need Point{3, Float32}
).
If you want to, you can use this as a low-level
interface, and define higher level functions like lines
on top of it.
from contour.jl.
Hm. We currently depend on FixedSizeArrays
, but I think it would be more appropriate to depend on GeometryTypes
directly, and re-use as many as possible of the types there. I'll re-work #30 to this end.
from contour.jl.
After looking at it again, it turns out that the relevant types from GeometryTypes
are basically just re-exported from FixedSizeArrays
. I won't go through the hassle, then :)
from contour.jl.
Haha yeah that's right. It would be rather about the LineSegment
types and decompose
;)
If you have a nice and simple line type lying around, you could also add it to GeometryTypes
if you want.
from contour.jl.
Hm. The LineSegment
type could definitely provide a better abstraction over curves than our Curve2
; is there a type (or typealias) in GeometryTypes
representing a curve? Or is that just a Vector{LineSegment}
?
from contour.jl.
Currently it is. But I think a curve should be another type, since linesegments are not joined... Or so I would think ;)
from contour.jl.
Yeah, true. Then for the moment we should probably stick with our Curve2{T}
(which is just a wrapper around a Vector{Point2{T}}
) 😄
from contour.jl.
Hehe, yeah I don't see why not!
from contour.jl.
Now that #32 is merged, we can re-work the internal representation of everything without breaking the publicly documented API. Closing this.
from contour.jl.
Related Issues (20)
- Upgrade error HOT 5
- Broken on Julia 0.4 HOT 5
- Ambiguity warnings on 0.4
- Broken on 0.4 master HOT 5
- Build contours from irregular and unsorted data HOT 1
- Contour not finding all branches of multi-branch contours HOT 2
- Disable CI builds on OSX?
- Help wanted! HOT 6
- Error tagging new release
- accept non-float z
- Performance Improvements and New Algorithms HOT 3
- display() error HOT 1
- Tests depend on hasing algorithm in Base HOT 2
- TagBot trigger issue HOT 15
- Extracting the indices of the contour HOT 5
- Contour line from specific point HOT 2
- v0.6.0 Documentation Updates
- `contour` fails on arrays of integers HOT 2
- Contours of discntinuous data 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 contour.jl.