Age | Commit message (Collapse) | Author |
|
Use the bilinear reverse to find the pixel to bleed from.
Was using pixel space which didn't work well.
|
|
Also add a faster, non-normalized version of the function.
(Neither are used currently used).
|
|
|
|
Can be used to check if a point is inside the 2-planes defined by a face-corner.
|
|
- area_quad_v3 now works correctly with concave quads.
- add area_squared_*** functions, to use when comparing to avoid a sqrt().
|
|
This changes BKE's fitting code to use `BKE_camera_params_compute_viewplane` instead of
`BKE_camera_view_frame`. This allows that code to work with orthographic projection too.
Also, two funcs were added to rna's Object, to resp. get the projection matrix of that
object (mostly useful for cameras and lamps objects), and return position this object
should be to see all (to fit) a given set of points.
Reviewers: campbellbarton
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D961
|
|
|
|
Resulting triangles could be pointing in opposing directions.
|
|
|
|
|
|
also add transform_point_by_seg_v3
|
|
also add unsigned versions
|
|
Add to Python via mathutils.geometry
|
|
This was a ToDo item, for mesh-based rigid body shapes (trimesh, convex)
the operator was simply using the bounding box volume, which can grossly
overestimate the volume and mass.
Calculating the actual volume of a mesh is not so difficult after all,
see e.g.
http://research.microsoft.com/en-us/um/people/chazhang/publications/icip01_ChaZhang.pdf
This patch also allows calculating the center-of-mass in the same way.
This is currently unused, because the rigid body system assumes the CoM
to be the same as the geometric object center. This is fine most of the
time, adding such user settings for "center-of-mass offset" would also
add quite a bit of complexity in user space, but it could be necessary
at some point. A number of other physical properties could be calculated
using the same principle, e.g. the moment of inertia.
|
|
|
|
|
|
bypass angle calculation to avoids (asin, sqrt, cos).
|
|
build the matrix directly rather then calculating with axis/angle
also remove unused function calc_poly_plane
|
|
add normal_poly_v3
|
|
|
|
|
|
|
|
|
|
Compute barycentric coordinates (u, v) for a point with respect to a
triangle.
This is needed for Cycles baking but we decided to push this
independently of the upcoming main baking changes.
Code adapted from Christer Ericson's Real-Time Collision Detection.
Cleanup, refactoring and review from Campbell Barton.
|
|
|
|
the inline definitions are included, which gives lots of warnings
"attribute declaration must precede definition".
See also rB83617429cf28f2a19e991a0f71d892fc159a4419
|
|
edge loops
Issue was in BLI's rotation_between_vecs_to_quat(), which did not handled correctly cases where both vectors are colinear.
Patch by Campbell Barton and me.
Issue originaly tracked down by Yan Shi, many thanks!
|
|
|
|
|
|
|
|
|
|
EWA sampling is designed for downsampling images, i.e. scaling down the size of
input image pixels, which happens regularly in compositing. While the standard
sampling methods (linear, cubic) work reasonably well for linear
transformations, they don't yield good results in non-linear cases like
perspective projection or arbitrary displacement. EWA sampling is comparable to
mipmapping, but avoids problems with discontinuities.
To work correctly the EWA algorithm needs partial derivatives of the mapping
functions which convert output pixel coordinates back into the input image
space (2x2 Jacobian matrix). With these derivatives the EWA algorithm
projects ellipses into the input space and accumulates colors over their
area. This calculation was not done correctly in the compositor, only the
derivatives du/dx and dv/dy were calculation, basically this means it only
worked for non-rotated input images.
The patch introduces full derivative calculations du/dx, du/dy, dv/dx, dv/dy for
the 3 nodes which use EWA sampling currently: PlaneTrackWarp, MapUV and
Displace. In addition the calculation of ellipsis area and axis-aligned
bounding boxes has been fixed.
For the MapUV and Displace nodes the derivatives have to be estimated by
evaluating the UV/displacement inputs with 1-pixel offsets, which can still have
problems on discontinuities and sub-pixel variations. These potential problems
can only be alleviated by more radical design changes in the compositor
functions, which are out of scope for now. Basically the values passed to the
UV/Displacement inputs would need to be associated with their 1st order
derivatives, which requires a general approach to derivatives in all nodes.
|
|
also added utility macro for removing elements in the middle of an array
|
|
|
|
2d pixel filling for drawing and selection.
|
|
isect_point_poly_v2() - add argument to check overlapping areas.
|
|
Instead of having ifdef __GNUC__ all over the headers
to use special compiler's hints use a special file where
all things like this are concentrated.
Makes code easier to follow and allows to manage special
attributes in more efficient way.
Thanks Campbell for review!
|
|
Remove no_flip option for isect_line_plane_v3(), its quite specific and only used for ED_view3d_win_to_3d().
|
|
ortho.
Now cut lines detect vertices that they pass (almost) exactly over
and snap to them, to avoid making verts vert close to other ones.
Added radius arg to BKE_bmbvh_ray_cast so that can detect an obscuring
face when the ray might otherwise go exactly between two triangles.
Needed an isect_line_tri_epsilon function for similar reason.
Fixes last part of bug #35002. Other knife bugs still present but
getting this commit in now before continuing bug fixing.
|
|
|
|
also correct python mathutils api, was missing vector checks.
|
|
|
|
- plane_point_side_v3(), a bit like line_point_side_v2()
- isect_point_planes_v3(), moved from paint_hide.c
functions to convert between point/normal pairs.
- plane_from_point_normal_v3()
- plane_to_point_normal_v3()
|
|
array bounds,
not that bad since it wasn't read but this isnt good practice and its simple to avoid.
|
|
- IsectLLPt2Df
- isect_point_quad_uv_v2
- isect_point_face_uv_v2
These are obsoleted by resolve_tri_uv, resolve_quad_uv
also add attributes for unused function results for some math functions.
|
|
twice as much as was needed.
|
|
|
|
- no need to allocate polygon normal array.
- no need to use BLI_array_ functions (realloc's).
- reduce some of the looping.
|
|
view clipping).
use in ED_view3d_win_to_segment_clip() and fix error, was clipping by only 4 planes rather then 6.
|
|
|