Skip to content

Commit

Permalink
Remove polygonize docs to test
Browse files Browse the repository at this point in the history
  • Loading branch information
skygering committed Jan 23, 2024
1 parent bf21c03 commit d1549bc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/methods/barycentric.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export MeanValue
# ## Example
# This example was taken from [this page of CGAL's documentation](https://doc.cgal.org/latest/Barycentric_coordinates_2/index.html).

# barycentric
# ```@example barycentric
# using GeometryOps, Makie
# using GeometryOps.GeometryBasics
# # Define a polygon
Expand Down Expand Up @@ -97,7 +97,7 @@ export MeanValue
# xautolimits = false, yautolimits = false
# )
# f
#
# ```

# ## Barycentric-coordinate API
# In some cases, we actually want barycentric interpolation, and have no interest
Expand Down Expand Up @@ -298,7 +298,7 @@ function barycentric_coordinates!(λs::Vector{<: Real}, ::MeanValue, polypoints:
return λs
end

# julia
# ```julia
# function barycentric_coordinates(::MeanValue, polypoints::NTuple{N, Point{2, T2}}, point::Point{2, T1},) where {N, T1, T2}
# ## Initialize counters and register variables
# ## Points - these are actually vectors from point to vertices
Expand Down Expand Up @@ -331,7 +331,7 @@ end
# λs[i] / ∑λ
# end
# end
#
# ```

# This performs an inplace accumulation, using less memory and is faster.
# That's particularly good if you are using a polygon with a large number of points...
Expand Down
20 changes: 10 additions & 10 deletions src/methods/polygonize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ export polygonize

# The main entry point is the [`polygonize`](@ref) function.

# ```@doc

# polygonize
# ```


# ## Example

# Here's a basic implementation, using the `Makie.peaks()` function. First, let's investigate the nature of the function:
# ```@example polygonize

# using Makie, GeometryOps
# n = 49
# xs, ys = LinRange(-3, 3, n), LinRange(-3, 3, n)
Expand All @@ -24,28 +24,28 @@ export polygonize
# )
# cb = Colorbar(f[1, 2], p; label = "Z-value")
# f
# ```


# Now, we can use the `polygonize` function to convert the raster data into polygons.

# For this particular example, we chose a range of z-values between 0.8 and 3.2,
# which would provide two distinct polyogns with holes.

# ```@example polygonize

# polygons = polygonize(xs, ys, 0.8 .< zs .< 3.2)
# ```

# This returns a list of `GeometryBasics.Polygon`, which can be plotted immediately,
# or wrapped directly in a `GeometryBasics.MultiPolygon`. Let's see how these look:

# ```@example polygonize

# f, a, p = poly(polygons; label = "Polygonized polygons", axis = (; aspect = DataAspect()))
# ```


# Finally, let's plot the Makie contour lines on top, to see how well the polygonization worked:
# ```@example polygonize

# contour!(a, zs; labels = true, levels = [0.8, 3.2], label = "Contour lines")
# f
# ```


# ## Implementation

Expand Down

0 comments on commit d1549bc

Please sign in to comment.