Paste P529

Snippet for T52732
ActivePublic

Authored by Sergey Sharybin (sergey) on Thu, Sep 14, 11:12 AM.
Tags
None
Subscribers
None
1diff --git a/source/blender/blenkernel/intern/particle_distribute.c b/source/blender/blenkernel/intern/particle_distribute.c
2index fe84504327c..63ef8497901 100644
3--- a/source/blender/blenkernel/intern/particle_distribute.c
4+++ b/source/blender/blenkernel/intern/particle_distribute.c
5@@ -213,12 +213,21 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
6​ copy_v3_v3(co2, co1);
7​ co2[a] += delta[a] + 0.001f*d;
8​ co1[a] -= 0.001f*d;
9-
10+
11+ static const float co_x[3] = {-0.094729f, 0.130299f, 0.035438f};
12+ bool dump = false;
13+ if (len_v3v3(co1, co_x) < 1e-6f) {
14+ dump = true;
15+ }
16+
17​ /* lets intersect the faces */
18​ for (i=0; i<totface; i++,mface++) {
19​ copy_v3_v3(v1, mvert[mface->v1].co);
20​ copy_v3_v3(v2, mvert[mface->v2].co);
21​ copy_v3_v3(v3, mvert[mface->v3].co);
22+ if (dump && i == 15539) {
23+ printf("isect_axial_line_segment_tri_v3 is about to fail\n");
24+ }
25
26​ bool intersects_tri = isect_axial_line_segment_tri_v3(a, co1, co2, v2, v3, v1, &lambda);
27​ if (intersects_tri) {