text stringlengths 81 112k |
|---|
Parses strings of strike and dip and returns strike and dip measurements
following the right-hand-rule.
Dip directions are parsed, and if the measurement does not follow the
right-hand-rule, the opposite end of the strike measurement is returned.
Accepts either quadrant-formatted or azimuth-formatted ... |
Parses strings of strike, dip, and rake and returns a strike, dip, and rake
measurement following the right-hand-rule, with the "end" of the strike
that the rake is measured from indicated by the sign of the rake (positive
rakes correspond to the strike direction, negative rakes correspond to the
opposi... |
Parses strings of plunge and bearing and returns a consistent plunge and
bearing measurement as floats. Plunge angles returned by this function will
always be between 0 and 90.
If no direction letter(s) is present, the plunge is assumed to be measured
from the end specified by the bearing. If a directi... |
Converts a planar measurment of dip direction using the dip-azimuth
convention into a strike using the right-hand-rule.
Parameters
----------
azimuth : number or string
The dip direction of the plane in degrees. This can be either a
numerical azimuth in the 0-360 range or a string repre... |
Converts a planar measurement of strike using the right-hand-rule into the
dip direction (i.e. the direction that the plane dips).
Parameters
----------
strike : number or string
The strike direction of the plane in degrees. This can be either a
numerical azimuth in the 0-360 range or a... |
Parses an azimuth measurement in azimuth or quadrant format.
Parameters
-----------
azimuth : string or number
An azimuth measurement in degrees or a quadrant measurement of azimuth.
Returns
-------
azi : float
The azimuth in degrees clockwise from north (range: 0-360)
See... |
Parses a quadrant measurement of the form "AxxB", where A and B are cardinal
directions and xx is an angle measured relative to those directions.
In other words, it converts a measurement such as E30N into an azimuth of
60 degrees, or W10S into an azimuth of 260 degrees.
For ambiguous quadrant measure... |
Return the inverse of the transform.
def inverted(self):
"""Return the inverse of the transform."""
# This is a bit of hackery so that we can put a single "inverse"
# function here. If we just made "self._inverse_type" point to the class
# in question, it wouldn't be defined yet. This w... |
Converts a longitude and latitude (or sequence of lons and lats) given in
_radians_ to cartesian coordinates, `x`, `y`, `z`, where x=0, y=0, z=0 is
the center of the globe.
Parameters
----------
lon : array-like
Longitude in radians
lat : array-like
Latitude in radians
Retu... |
Converts cartesian coordinates `x`, `y`, `z` into a longitude and latitude.
x=0, y=0, z=0 is assumed to correspond to the center of the globe.
Returns lon and lat in radians.
Parameters
----------
`x`, `y`, `z` : Arrays of cartesian coordinates
Returns
-------
lon : Longitude in radian... |
Rotate "lon", "lat" coords (in _degrees_) about the X-axis by "theta"
degrees. This effectively simulates rotating a physical stereonet.
Returns rotated lon, lat coords in _radians_).
def _rotate(lon, lat, theta, axis='x'):
"""
Rotate "lon", "lat" coords (in _degrees_) about the X-axis by "theta"
... |
Calculates the antipode (opposite point on the globe) of the given point or
points. Input and output is expected to be in radians.
Parameters
----------
lon : number or sequence of numbers
Longitude in radians
lat : number or sequence of numbers
Latitude in radians
Returns
... |
Calculates the longitude and latitude of `segments` points along the
stereonet projection of each plane with a given `strike` and `dip` in
degrees. Returns points for one hemisphere only.
Parameters
----------
strike : number or sequence of numbers
The strike of the plane(s) in degrees, wi... |
Calculates the longitude and latitude of the pole(s) to the plane(s)
specified by `strike` and `dip`, given in degrees.
Parameters
----------
strike : number or sequence of numbers
The strike of the plane(s) in degrees, with dip direction indicated by
the azimuth (e.g. 315 vs. 135) spec... |
Calculates the longitude and latitude of the linear feature(s) specified by
`strike`, `dip`, and `rake_angle`.
Parameters
----------
strike : number or sequence of numbers
The strike of the plane(s) in degrees, with dip direction indicated by
the azimuth (e.g. 315 vs. 135) specified fol... |
Calculates the longitude and latitude of the linear feature(s) specified by
`plunge` and `bearing`.
Parameters
----------
plunge : number or sequence of numbers
The plunge of the line(s) in degrees. The plunge is measured in degrees
downward from the end of the feature specified by the ... |
Calculates the longitude and latitude of the small circle (i.e. a cone)
centered at the given *plunge* and *bearing* with an apical angle of
*angle*, all in degrees.
Parameters
----------
plunge : number or sequence of numbers
The plunge of the center of the cone(s) in degrees. The plunge i... |
Converts the given `plunge` and `bearing` in degrees to a strike and dip
of the plane whose pole would be parallel to the line specified. (i.e. The
pole to the plane returned would plot at the same point as the specified
plunge and bearing.)
Parameters
----------
plunge : number or sequence of ... |
Converts the given *strike* and *dip* in dgrees of a plane(s) to a plunge
and bearing of its pole.
Parameters
----------
strike : number or sequence of numbers
The strike of the plane(s) in degrees, with dip direction indicated by
the azimuth (e.g. 315 vs. 135) specified following the "... |
Returns the resultant vector from a series of longitudes and latitudes
Parameters
----------
lons : array-like
A sequence of longitudes (in radians)
lats : array-like
A sequence of latitudes (in radians)
Returns
-------
mean_vec : tuple
(lon, lat) in radians
r_v... |
Returns the resultant vector from a series of longitudes and latitudes. If
a confidence is set the function additionally returns the opening angle
of the confidence small circle (Fisher, 19..) and the dispersion factor
(kappa).
Parameters
----------
lons : array-like
A sequence of longi... |
Converts a longitude and latitude (from a stereonet) into the strike and dip
of the plane whose pole lies at the given longitude(s) and latitude(s).
Parameters
----------
lon : array-like
A sequence of longitudes (or a single longitude) in radians
lat : array-like
A sequence of lati... |
Converts longitude and latitude in stereonet coordinates into a
plunge/bearing.
Parameters
----------
lon, lat : numbers or sequences of numbers
Longitudes and latitudes in radians as measured from a
lower-hemisphere stereonet
Returns
-------
plunge : array
The plun... |
Finds the intersection of two planes. Returns a plunge/bearing of the linear
intersection of the two planes.
Also accepts sequences of strike1s, dip1s, strike2s, dip2s.
Parameters
----------
strike1, dip1 : numbers or sequences of numbers
The strike and dip (in degrees, following the right... |
Projects a linear feature(s) onto the surface of a plane. Returns a rake
angle(s) along the plane.
This is also useful for finding the rake angle of a feature that already
intersects the plane in question.
Parameters
----------
strike, dip : numbers or sequences of numbers
The strike a... |
Projects an azimuth of a linear feature onto a plane as a rake angle.
Parameters
----------
strike, dip : numbers
The strike and dip of the plane in degrees following the
right-hand-rule.
azimuth : numbers
The azimuth of the linear feature in degrees clockwise from north (i.e.
... |
Converts x, y, z in _world_ cartesian coordinates into lower-hemisphere
stereonet coordinates.
Parameters
----------
x, y, z : array-likes
Sequences of world coordinates
Returns
-------
lon, lat : arrays
Sequences of longitudes and latitudes (in radians)
def xyz2stereonet(... |
Converts a sequence of longitudes and latitudes from a lower-hemisphere
stereonet into _world_ x,y,z coordinates.
Parameters
----------
lon, lat : array-likes
Sequences of longitudes and latitudes (in radians) from a
lower-hemisphere stereonet
Returns
-------
x, y, z : arra... |
Calculate the angular distance between two linear features or elementwise
angular distance between two sets of linear features. (Note: a linear
feature in this context is a point on a stereonet represented
by a single latitude and longitude.)
Parameters
----------
first : (lon, lat) 2xN array-l... |
Reproject data such that ``center`` is the north pole. Returns lon, lat
in the new, rotated reference frame.
This is currently a sketch for a later function. Do not assume it works
correctly.
def _repole(lon, lat, center):
"""
Reproject data such that ``center`` is the north pole. Returns lon, lat... |
Unifies ``fit_pole`` and ``fit_girdle``.
def _sd_of_eigenvector(data, vec, measurement='poles', bidirectional=True):
"""Unifies ``fit_pole`` and ``fit_girdle``."""
lon, lat = _convert_measurements(data, measurement)
vals, vecs = cov_eig(lon, lat, bidirectional)
x, y, z = vecs[:, vec]
s, d = stereon... |
Finds the 3 eigenvectors and eigenvalues of the 3D covariance matrix of a
series of geometries. This can be used to fit a plane/pole to a dataset or
for shape fabric analysis (e.g. Flinn/Hsu plots).
Input arguments will be interpreted as poles, lines, rakes, or "raw"
longitudes and latitudes based on ... |
Returns the mean vector for a set of measurments. By default, this expects
the input to be plunges and bearings, but the type of input can be
controlled through the ``measurement`` kwarg.
Parameters
----------
*args : 2 or 3 sequences of measurements
By default, this will be expected to be... |
Returns the mean vector and summary statistics for a set of measurements.
By default, this expects the input to be plunges and bearings, but the type
of input can be controlled through the ``measurement`` kwarg.
Parameters
----------
*args : 2 or 3 sequences of measurements
By default, this... |
Find centers of multi-modal clusters of data using a kmeans approach
modified for spherical measurements.
Parameters
----------
*args : 2 or 3 sequences of measurements
By default, this will be expected to be ``strike`` & ``dip``, both
array-like sequences representing poles to planes.... |
Connection state check from SQLAlchemy:
https://bitbucket.org/sqlalchemy/sqlalchemy/src/tip/lib/sqlalchemy/dialects/postgresql/psycopg2.py
def is_disconnect(e, connection, cursor):
"""
Connection state check from SQLAlchemy:
https://bitbucket.org/sqlalchemy/sqlalchemy/src/tip/lib/sqlalchemy/dialects/po... |
Dispose of the pool for this instance, closing all connections.
def _dispose(self):
"""Dispose of the pool for this instance, closing all connections."""
self.close()
# _DBProxy.dispose doesn't actually call dispose on the pool
conn_params = self.get_connection_params()
key = db... |
Calculates shape of data after encoding.
Parameters
----------
img_height : int
Height of input image.
img_width : int
Width of input image.
Returns
-------
encoded_shape : tuple(int)
Gives back 3-tuple with new dims.
def calc_fc_size(img_height, img_width):
''... |
Calculates shape of data after decoding.
Parameters
----------
img_height : int
Height of encoded data.
img_width : int
Width of encoded data.
Returns
-------
encoded_shape : tuple(int)
Gives back 2-tuple with decoded image dimensions.
def calc_im_size(img_height, ... |
Gets all the paths of non-hidden files in a directory
and returns a list of those paths.
Parameters
----------
directory : str
The directory whose contents you wish to grab.
Returns
-------
paths : List[str]
def get_paths(directory):
'''Gets all the paths of non-hidden file... |
Resizes all images with given paths to new dimensions.
Uses up/downscaling with antialiasing.
Parameters
----------
file_paths : List[str]
List of path strings for image to resize.
new_dir : str
Directory to place resized images.
width : int
Target width of new resiz... |
Transform latent vectors into images.
Parameters
----------
data : array-like shape (n_images, latent_width)
Input numpy array of images.
test [optional] : bool
Controls the test boolean for batch normalization.
Returns
-------
images : a... |
Load in image files from list of paths.
Parameters
----------
filepaths : List[str]
List of file paths of images to be loaded.
Returns
-------
images : array-like shape (n_images, n_colors, image_width, image_height)
Images normalized to have pi... |
Fit the VAE model to the image data.
Parameters
----------
img_data : array-like shape (n_images, n_colors, image_width, image_height)
Images used to fit VAE model.
save_freq [optional] : int
Sets the number of epochs to wait before saving the model and optimize... |
Saves model as a sequence of files in the format:
{path}/{name}_{'model', 'opt', 'meta'}.h5
Parameters
----------
path : str
The directory of the file you wish to save the model to.
name : str
The name prefix of the model and optimizer files you wish
... |
Loads in model as a class instance with with the specified
model and optimizer states.
Parameters
----------
model : str
Path to the model state file.
opt : str
Path to the optimizer state file.
meta : str
Path to the class metadata... |
Fit the GAN model to the image data.
Parameters
----------
img_data : array-like shape (n_images, n_colors, image_width, image_height)
Images used to fit VAE model.
save_freq [optional] : int
Sets the number of epochs to wait before saving the model and optimize... |
Saves model as a sequence of files in the format:
{path}/{name}_{'dec', 'disc', 'dec_opt',
'disc_opt', 'meta'}.h5
Parameters
----------
path : str
The directory of the file you wish to save the model to.
name : str
The name prefix of the m... |
Transform image data to latent space.
Parameters
----------
data : array-like shape (n_images, image_width, image_height,
n_colors)
Input numpy array of images.
test [optional] : bool
Controls the test boolean for batch normaliz... |
Fit the VAE/GAN model to the image data.
Parameters
----------
img_data : array-like shape (n_images, n_colors, image_width, image_height)
Images used to fit VAE model.
gamma [optional] : float
Sets the multiplicative factor that weights the relative importance ... |
Loads in model as a class instance with with the specified
model and optimizer states.
Parameters
----------
enc : str
Path to the encoder state file.
dec : str
Path to the decoder/generator state file.
disc : str
Path to the discri... |
r"""Determine the "sign" of a polynomial on the reference triangle.
.. note::
This is used **only** by :meth:`Surface._compute_valid` (which is
in turn used to compute / cache the :attr:`Surface.is_valid`
property).
Checks if a polynomial :math:`p(s, t)` is positive, negative
or mixe... |
r"""Compute the Jacobian determinant of a quadratic surface.
.. note::
This is used **only** by :meth:`Surface._compute_valid` (which is
in turn used to compute / cache the :attr:`Surface.is_valid`
property).
Converts :math:`\det(J(s, t))` to a polynomial on the reference
triangle an... |
r"""Compute the Jacobian determinant of a cubic surface.
.. note::
This is used **only** by :meth:`Surface._compute_valid` (which is
in turn used to compute / cache the :attr:`Surface.is_valid`
property).
Converts :math:`\det(J(s, t))` to a polynomial on the reference
triangle and re... |
r"""Performs one "round" of the de Casteljau algorithm for surfaces.
.. note::
There is also a Fortran implementation of this function, which
will be used if it can be built.
.. note::
This is a helper function, used by :func:`make_transform` and
:func:`_specialize_surface` (and ... |
Compute matrices corresponding to the de Casteljau algorithm.
.. note::
This is a helper used only by :func:`_specialize_surface`.
Applies the de Casteljau to the identity matrix, thus
effectively caching the algorithm in a transformation matrix.
.. note::
This is premature optimizati... |
r"""Converts a reduced values dictionary into a matrix.
.. note::
This is a helper used only by :func:`_specialize_surface`.
The ``vals_by_weight`` mapping has keys of the form:
``(0, ..., 1, ..., 2, ...)`` where the ``0`` corresponds
to the number of times the first set of barycentric
wei... |
Specialize a surface to a reparameterization
.. note::
There is also a Fortran implementation of this function, which
will be used if it can be built.
Does so by taking three points (in barycentric form) within the
reference triangle and then reparameterizing the surface onto
the triang... |
Subdivide a surface into four sub-surfaces.
.. note::
There is also a Fortran implementation of this function, which
will be used if it can be built.
Does so by taking the unit triangle (i.e. the domain of the surface) and
splitting it into four sub-triangles by connecting the midpoints of ... |
r"""Compute :math:`\frac{\partial B}{\partial s}`.
.. note::
This is a helper for :func:`_jacobian_both`, which has an
equivalent Fortran implementation.
Args:
nodes (numpy.ndarray): Array of nodes in a surface.
degree (int): The degree of the surface.
dimension (int): T... |
r"""Compute :math:`s` and :math:`t` partial of :math:`B`.
.. note::
There is also a Fortran implementation of this function, which
will be used if it can be built.
Args:
nodes (numpy.ndarray): Array of nodes in a surface.
degree (int): The degree of the surface.
dimensio... |
r"""Compute :math:`\det(D B)` at a set of values.
This requires that :math:`B \in \mathbf{R}^2`.
.. note::
This assumes but does not check that each ``(s, t)``
in ``st_vals`` is inside the reference triangle.
.. warning::
This relies on helpers in :mod:`bezier` for computing the
... |
Helper for func:`classify_intersection` at tangencies.
.. note::
This is a helper used only by :func:`classify_intersection`.
Args:
intersection (.Intersection): An intersection object.
nodes1 (numpy.ndarray): Control points for the first curve at
the intersection.
... |
Check ignored when a corner lies **inside** another edge.
.. note::
This is a helper used only by :func:`ignored_corner`, which in turn is
only used by :func:`classify_intersection`.
Helper for :func:`ignored_corner` where one of ``s`` and
``t`` are ``0``, but **not both**.
Args:
... |
Check if an intersection is an "ignored" double corner.
.. note::
This is a helper used only by :func:`ignored_corner`, which in turn is
only used by :func:`classify_intersection`.
Helper for :func:`ignored_corner` where both ``s`` and
``t`` are ``0``.
Does so by checking if either edg... |
Check if an intersection is an "ignored" corner.
.. note::
This is a helper used only by :func:`classify_intersection`.
An "ignored" corner is one where the surfaces just "kiss" at
the point of intersection but their interiors do not meet.
We can determine this by comparing the tangent lines ... |
r"""Determine which curve is on the "inside of the intersection".
.. note::
This is a helper used only by :meth:`.Surface.intersect`.
This is intended to be a helper for forming a :class:`.CurvedPolygon`
from the edge intersections of two :class:`.Surface`-s. In order
to move from one intersec... |
Updates intersection parameters if it is on the end of an edge.
.. note::
This is a helper used only by :meth:`.Surface.intersect`.
Does nothing if the intersection happens in the middle of two
edges.
If the intersection occurs at the end of the first curve,
moves it to the beginning of t... |
Rotates a node to the "front".
.. note::
This is a helper used only by :func:`basic_interior_combine`, which in
turn is only used by :func:`combine_intersections`.
If a node is at the end of a segment, moves it to the beginning
of the next segment (at the exact same point). We assume that
... |
Gets the next node along the current (first) edge.
.. note::
This is a helper used only by :func:`get_next`, which in
turn is only used by :func:`basic_interior_combine`, which itself
is only used by :func:`combine_intersections`.
Along with :func:`get_next_second`, this function does th... |
Gets the next node along the current (second) edge.
.. note::
This is a helper used only by :func:`get_next`, which in
turn is only used by :func:`basic_interior_combine`, which itself
is only used by :func:`combine_intersections`.
Along with :func:`get_next_first`, this function does th... |
Gets the next node along the current (coincident) edge.
.. note::
This is a helper used only by :func:`get_next`, which in
turn is only used by :func:`basic_interior_combine`, which itself
is only used by :func:`combine_intersections`.
Along with :func:`get_next_first` and :func:`get_nex... |
Gets the next node along a given edge.
.. note::
This is a helper used only by :func:`basic_interior_combine`, which in
turn is only used by :func:`combine_intersections`. This function does
the majority of the heavy lifting for :func:`basic_interior_combine`.
.. note::
This fun... |
Convert a "pair" of intersection nodes to a curve segment.
.. note::
This is a helper used only by :func:`basic_interior_combine`, which in
turn is only used by :func:`combine_intersections`.
.. note::
This function could specialize to the first or second segment
attached to ``st... |
r"""Determine if one surface is in the other.
Helper for :func:`combine_intersections` that handles the case
of no points of intersection. In this case, either the surfaces
are disjoint or one is fully contained in the other.
To check containment, it's enough to check if one of the corners
is cont... |
Determine intersection in the case of only-tangent intersections.
If the only intersections are tangencies, then either the surfaces
are tangent but don't meet ("kissing" edges) or one surface is
internally tangent to the other.
Thus we expect every intersection to be classified as
:attr:`~.Inters... |
Combine intersections that don't involve tangencies.
.. note::
This is a helper used only by :func:`combine_intersections`.
.. note::
This helper assumes ``intersections`` isn't empty, but doesn't
enforce it.
Args:
intersections (List[.Intersection]): Intersections from eac... |
r"""Combine curve-curve intersections into curved polygon(s).
.. note::
This is a helper used only by :meth:`.Surface.intersect`.
Does so assuming each intersection lies on an edge of one of
two :class:`.Surface`-s.
.. note ::
This assumes that each ``intersection`` has been classifie... |
r"""Compute a point on a surface.
Evaluates :math:`B\left(\lambda_1, \lambda_2, \lambda_3\right)` for a
B |eacute| zier surface / triangle defined by ``nodes``.
.. note::
There is also a Fortran implementation of this function, which
will be used if it can be built.
Args:
nodes... |
r"""Compute multiple points on the surface.
.. note::
There is also a Fortran implementation of this function, which
will be used if it can be built.
Args:
nodes (numpy.ndarray): Control point nodes that define the surface.
degree (int): The degree of the surface define by ``nod... |
r"""Compute multiple points on the surface.
.. note::
There is also a Fortran implementation of this function, which
will be used if it can be built.
Args:
nodes (numpy.ndarray): Control point nodes that define the surface.
degree (int): The degree of the surface define by ``nod... |
Compute the nodes of each edges of a surface.
.. note::
There is also a Fortran implementation of this function, which
will be used if it can be built.
Args:
nodes (numpy.ndarray): Control point nodes that define the surface.
degree (int): The degree of the surface define by ``n... |
r"""Compute an auxiliary "shoelace" sum used to compute area.
.. note::
This is a helper for :func:`_compute_area`.
Defining :math:`\left[i, j\right] = x_i y_j - y_i x_j` as a shoelace
term illuminates the name of this helper. On a degree one curve, this
function will return
.. math::
... |
Save an image to the docs images directory.
Args:
filename (str): The name of the file (not containing
directory info).
def save_image(figure, filename):
"""Save an image to the docs images directory.
Args:
filename (str): The name of the file (not containing
direc... |
Fill out the columns of matrix with a series of points.
This is because ``np.hstack()`` will just make another 1D vector
out of them and ``np.vstack()`` will put them in the rows.
Args:
points (Tuple[numpy.ndarray, ...]): Tuple of 1D points (i.e.
arrays with shape ``(2,)``.
Return... |
Image for :func:`.linearization_error` docstring.
def linearization_error(nodes):
"""Image for :func:`.linearization_error` docstring."""
if NO_IMAGES:
return
curve = bezier.Curve.from_nodes(nodes)
line = bezier.Curve.from_nodes(nodes[:, (0, -1)])
midpoints = np.hstack([curve.evaluate(0.5)... |
Image for :func:`.newton_refine` docstring.
def newton_refine1(s, new_s, curve1, t, new_t, curve2):
"""Image for :func:`.newton_refine` docstring."""
if NO_IMAGES:
return
points = np.hstack([curve1.evaluate(s), curve2.evaluate(t)])
points_new = np.hstack([curve1.evaluate(new_s), curve2.evaluat... |
Image for :func:`.newton_refine` docstring.
def newton_refine2(s_vals, curve1, curve2):
"""Image for :func:`.newton_refine` docstring."""
if NO_IMAGES:
return
ax = curve1.plot(256)
ax.lines[-1].zorder = 1
curve2.plot(256, ax=ax)
ax.lines[-1].zorder = 1
points = curve1.evaluate_mult... |
Image for :func:`.segment_intersection` docstring.
def segment_intersection1(start0, end0, start1, end1, s):
"""Image for :func:`.segment_intersection` docstring."""
if NO_IMAGES:
return
line0 = bezier.Curve.from_nodes(stack1d(start0, end0))
line1 = bezier.Curve.from_nodes(stack1d(start1, end1... |
Image for :func:`.segment_intersection` docstring.
def segment_intersection2(start0, end0, start1, end1):
"""Image for :func:`.segment_intersection` docstring."""
if NO_IMAGES:
return
line0 = bezier.Curve.from_nodes(stack1d(start0, end0))
line1 = bezier.Curve.from_nodes(stack1d(start1, end1))
... |
Image for :func:`.parallel_lines_parameters` docstring.
def helper_parallel_lines(start0, end0, start1, end1, filename):
"""Image for :func:`.parallel_lines_parameters` docstring."""
if NO_IMAGES:
return
figure = plt.figure()
ax = figure.gca()
points = stack1d(start0, end0, start1, end1)
... |
Image for :class`.Curve` docstring.
def curve_constructor(curve):
"""Image for :class`.Curve` docstring."""
if NO_IMAGES:
return
ax = curve.plot(256)
line = ax.lines[0]
nodes = curve._nodes
ax.plot(
nodes[0, :], nodes[1, :], color="black", linestyle="None", marker="o"
)
... |
Image for :meth`.Curve.evaluate` docstring.
def curve_evaluate(curve):
"""Image for :meth`.Curve.evaluate` docstring."""
if NO_IMAGES:
return
ax = curve.plot(256)
points = curve.evaluate_multi(np.asfortranarray([0.75]))
ax.plot(
points[0, :], points[1, :], color="black", linestyle=... |
Image for :meth`.Curve.subdivide` docstring.
def curve_subdivide(curve, left, right):
"""Image for :meth`.Curve.subdivide` docstring."""
if NO_IMAGES:
return
figure = plt.figure()
ax = figure.gca()
add_patch(ax, curve._nodes, "gray")
ax = left.plot(256, ax=ax)
line = ax.lines[-1]
... |
Image for :meth`.Curve.intersect` docstring.
def curve_intersect(curve1, curve2, s_vals):
"""Image for :meth`.Curve.intersect` docstring."""
if NO_IMAGES:
return
ax = curve1.plot(256)
curve2.plot(256, ax=ax)
intersections = curve1.evaluate_multi(s_vals)
ax.plot(
intersections[0... |
Image for :class`.Surface` docstring.
def surface_constructor(surface):
"""Image for :class`.Surface` docstring."""
if NO_IMAGES:
return
ax = surface.plot(256, with_nodes=True)
line = ax.lines[0]
nodes = surface._nodes
add_patch(ax, nodes[:, (0, 1, 2, 5)], line.get_color())
delta =... |
Image for :meth`.Surface.evaluate_barycentric` docstring.
def surface_evaluate_barycentric(surface, point):
"""Image for :meth`.Surface.evaluate_barycentric` docstring."""
if NO_IMAGES:
return
ax = surface.plot(256)
ax.plot(
point[0, :], point[1, :], color="black", linestyle="None", ma... |
Image for :meth`.Surface.evaluate_cartesian_multi` docstring.
def surface_evaluate_cartesian_multi(surface, points):
"""Image for :meth`.Surface.evaluate_cartesian_multi` docstring."""
if NO_IMAGES:
return
ax = surface.plot(256)
ax.plot(
points[0, :], points[1, :], color="black", lines... |
Image for :meth`.Surface.is_valid` docstring.
def surface_is_valid1(surface):
"""Image for :meth`.Surface.is_valid` docstring."""
if NO_IMAGES:
return
ax = surface.plot(256)
ax.axis("scaled")
ax.set_xlim(-0.125, 2.125)
ax.set_ylim(-0.125, 2.125)
save_image(ax.figure, "surface_is_va... |
Image for :meth`.Surface.is_valid` docstring.
def surface_is_valid3(surface):
"""Image for :meth`.Surface.is_valid` docstring."""
if NO_IMAGES:
return
edge1, edge2, edge3 = surface.edges
N = 128
# Compute points on each edge.
std_s = np.linspace(0.0, 1.0, N + 1)
points1 = edge1.eva... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.