|
| 1 | +# flatfv |
| 2 | + |
| 3 | +```julia |
| 4 | +FV = flatfv(I::Union{GMTimage, AbstractString}; shape=nothing, level=0.0)::GMTfv |
| 5 | +``` |
| 6 | + |
| 7 | +Create a flat 3D surface from an image and a set of xyz or xy coordinates. |
| 8 | + |
| 9 | +This function creates a face for each pixel in the image that is inside the `shape` and assigns the |
| 10 | +face's color from that of the image. So be careful that the image is not too large. As explained below, |
| 11 | +this function creates flat surfaces in any of the xy, xz or yz planes. While this may seam a big |
| 12 | +limitation, it can be circumvented by a posterior rotation of the image with the help of a rotation |
| 13 | +matrix created with the `eulermat` function. |
| 14 | + |
| 15 | +### Args |
| 16 | +- `I`: A \myreflink{GMTimage} object or a file name of an image. |
| 17 | + |
| 18 | +### Kwargs |
| 19 | +- `shape`: A xyz or xy polygon defining a flat surface. When it is a 3D polygon, it must lie in the xz or yz planes. |
| 20 | + But it can also be a can also be a Symbol; one of `:circle`, `:circ`, `:ellipse`. In this later case, we |
| 21 | + compute a normalized circle or ellipse with dimensions taken from number of rows and columns in `I`. |
| 22 | + The ellipse (with a horizontal major) eccentricity is computed from the ratio of the number of rows and columns. |
| 23 | + |
| 24 | +- `level`: In case that `shape` is a polygon in the xy plane, this is the level or height of that flat surface. |
| 25 | + For other plane orientations, this level is extracted from the column of constant values in `shape`. |
| 26 | + |
| 27 | +### Returns |
| 28 | +A \myreflink{GMTfv} FacesVertices object representing the flat 3D surface. |
| 29 | + |
| 30 | +Example |
| 31 | +------- |
| 32 | + |
| 33 | +\begin{examplefig}{} |
| 34 | +```julia |
| 35 | +using GMT |
| 36 | + |
| 37 | +FV = flatfv(TESTSDIR * "/assets/table_flowers.jpg", shape=:circle, level=1.0); |
| 38 | +viz(FV) |
| 39 | +``` |
| 40 | +\end{examplefig} |
| 41 | + |
| 42 | +See Also |
| 43 | +-------- |
| 44 | + |
| 45 | +\myreflink{extrude}, \myreflink{fv2fv}, \myreflink{loft}, \myreflink{grid2tri}, \myreflink{revolve}, \myreflink{surf2fv} |
0 commit comments