36f916f200
Math Lib: clamp closest_to_line_segment_v# when segment has no length
...
For a line this makes sense but segments should clamp,
avoids assert in edge-rip.
2015-12-23 22:08:15 +11:00
fa3fe2ee10
Cleanup: math lib naming
...
Distinguish between line / line_segment
2015-12-15 18:16:41 +11:00
a7c7ae5bf7
Cleanup: math lib naming
...
Rename not-very-descriptive (p1, d) -> (ray_origin, ray_direction)
2015-12-15 18:15:10 +11:00
87791c611d
Cleanup: consistent naming for closest_to_line api
2015-12-15 17:49:31 +11:00
becc85c5d4
Math Lib: 2d ray-segment intersection function
2015-12-11 11:27:00 +11:00
8c453b5995
Remove redundant zero area face check
2015-12-03 22:45:33 +11:00
a4e151704f
Fix isect_point_tri_v3 w/ degenerate faces
...
Ensure point_in_slice returns false when zero area faces are passed.
2015-12-03 22:37:46 +11:00
a7ac59414b
Cleanup: rename line to segments, avoids confusion
...
Differentiate between lines and segments.
2015-11-13 07:48:05 +11:00
0d54aa9c02
Fix T46521: Python: bvh.ray_cast doesn't find a plane facing in the other direction under certain circumstances
...
The issue was caused by wrong sign check. It originally came from more optimized
Cycles code where because of other reasons it wasn't visible yet. But in fact it
should be solved there as well.
2015-10-22 20:34:51 +05:00
99142ec7e0
BLI_math: isect_ray_plane_v3 now takes 4d plane
...
Was taking a triangle and doing ray-tri intersect.
2015-10-16 03:06:12 +11:00
b333a7570f
Cleanup: spelling
2015-10-07 15:02:06 +11:00
9a62164d94
Cleanup: indentation
2015-09-22 15:02:11 +10:00
b8e0b2db56
Math Lib: isect_plane_*_v3 avoid negation
...
Unmeasurable speedup for plane intersection.
2015-09-05 17:44:02 +10:00
ba188cf98d
Math Lib: simplify isect_plane_plane_v3
...
Unlike the 3 plane method, the 2 planes squared cross-product _is_ the determinant.
2015-09-05 17:10:07 +10:00
39752eb912
Fix for isect_tri_tri_epsilon_v3 w/ small faces
...
tris with ~1e-05 edge lengths would fail
2015-09-04 22:29:12 +10:00
1d71ad2eaa
Math Lib: Use plane intersect from graphics-gems
2015-09-04 22:13:20 +10:00
d0e7ba3fd1
Math Lib: avoid sqrt w/ triangle intersection
2015-09-04 22:06:36 +10:00
2ea96df159
Correct own error in line_point_factor
...
Passing zero epsilon allowed divide by zero.
2015-09-04 22:06:36 +10:00
54ad576666
Small tri intersect fails when not normalized
...
Logic was ok, but would run into precision issues.
2015-09-04 01:59:44 +10:00
a603a3470c
Revert fix for T45849 (part 2, tsk!)
2015-08-31 22:47:14 +10:00
06b14aa5f9
error in comments
2015-08-31 22:26:05 +10:00
6a53e658d3
Alternate fix for T45849: tri-tri intersect error
...
Project both triangles onto the same plane to simplify calculations.
2015-08-31 22:15:27 +10:00
e503e37333
Revert fix for T45849, alternate fix coming up
...
epsilon check here didn't account for scale, causing T45919
2015-08-31 22:12:19 +10:00
96fa58e22c
Math Lib: Add closest_to_plane helper functions
...
- closest_to_plane3 (for float3 planes)
- closest_to_plane*_normalized_v3 (for unit length planes)
Use when the plane is known to be unit length
2015-08-31 20:10:36 +10:00
50917edad5
Fix T45853: Edge-slide UV-correct jitter
2015-08-25 22:57:03 +10:00
e7775833a7
Math Lib: Use same logic for 2d/3d functions
...
dist_squared_to_line_v2, dist_to_line_v2
2015-08-23 19:10:37 +10:00
0cb23fafe7
Math Lib: minor optimization interp_weights_poly
2015-08-23 17:07:35 +10:00
58c9a0b11a
Cleanup: spelling
2015-08-22 21:17:32 +10:00
c1c07b68b8
Use epsilon for line-intersect collinear test
...
Also remove 2x vector normalize since other parts of the code already check this.
Fixes T45849
2015-08-22 21:12:46 +10:00
71919efd78
Math Lib: watertight intersection function
...
From Cycles with some very minor differences.
2015-08-21 17:45:04 +10:00
a6457f283e
Cleanup: comment out isect_ray_tri_threshold_v3
...
Also define epsilon var for ray-cast functions.
2015-08-20 12:50:39 +10:00
cd8581af8e
Fix T45706: Axis aligned tri-tri intersection
2015-08-19 12:20:39 +10:00
90655d06d4
Math Lib: add isect_tri_tri_epsilon_v3 function
2015-07-29 20:11:54 +10:00
9ae39a1312
Math Lib: use vector funcs for isect_line_line_v2_point
2015-07-21 21:49:29 +10:00
595a491e63
Add tessellation data to DerivedMesh (LoopTri)
...
This stores loop indices into the loop array giving easier acess
to data such as vertex-colors and UV's,
removing the need to store an MFace duplicate of custom-data.
This doesn't yet move all internal code from MFace to LoopTri just yet.
Only applies to:
- opengl drawing
- sculpting (pbvh)
- vertex/weight paint
Thanks to @psy-fi for review, fixes and improvements to drawing!
2015-07-17 03:55:14 +10:00
2cffd6649b
Match face tessellation order in edimode
...
add a negated version of axis_dominant_v3_to_m3
2015-07-14 22:29:31 +10:00
a33b1ce500
Correct recent error
2015-06-24 11:21:54 +10:00
f1bad1d16b
Improve dist_***_to_corner_v3v3v3 precision
...
Remove offset before calculating distance.
Define 'plane3' to BLI_math, since we often don't need the 4th component.
2015-06-24 07:21:11 +10:00
72e812de7c
Fix T45123: 2D line intersection fails
...
Co-linear lines could detect as intersecting even if they weren't overlapping.
2015-06-23 21:01:12 +10:00
ec8e0336a9
Cleanup: use 2d math funcs for line intersection
2015-06-23 21:01:11 +10:00
ecdbe3cc63
Cleanup: style
2015-06-17 07:06:59 +10:00
3f7ea7489e
Cleanup: quiet assert for zero-length axis
2015-06-16 04:16:27 +10:00
a050d6063c
Project Paint: resolve ugly bleed artifacts
...
Use the bilinear reverse to find the pixel to bleed from.
Was using pixel space which didn't work well.
2015-05-13 18:04:46 +10:00
6efcd9e8fe
Math Lib: redundant axis flip decomposing a plane
...
Also add a faster, non-normalized version of the function.
(Neither are used currently used).
2015-03-04 20:11:49 +11:00
e38dc33f80
Fix dist_signed_squared_to_corner_v3v3v3 with concave corners
2015-03-03 00:20:53 +11:00
421d0f3bde
Math Lib: add dist_signed_squared_to_corner_v3v3v3
...
Can be used to check if a point is inside the 2-planes defined by a face-corner.
2015-02-16 18:47:15 +11:00
3debcc8b51
Math Lib: improve area calculation
...
- area_quad_v3 now works correctly with concave quads.
- add area_squared_*** functions, to use when comparing to avoid a sqrt().
2015-01-13 19:10:15 +11:00
780bb88a7a
Refactor 'fit in camera view' code, and expose it to RNA.
...
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
2015-01-03 12:05:23 +01:00
01c04333f5
Fix T43034: beautify-fill leaves zero area tri's
2014-12-27 16:47:42 +11:00
53ec177b7f
optimize interp_weights_poly_v2, v3
...
use line_point_factor instead of length between vertices.
2014-12-26 08:46:48 +11:00