From dd70cb55a2bbd3241f8630a6cba1ec2e8658b505 Mon Sep 17 00:00:00 2001 From: Jonathan Westhues Date: Mon, 26 May 2008 16:34:26 -0800 Subject: [PATCH] Make it work when I insert against a NULL bsp3. [git-p4: depot-paths = "//depot/solvespace/": change = 1747] --- mesh.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mesh.cpp b/mesh.cpp index 6e37dd6..ae8cc4e 100644 --- a/mesh.cpp +++ b/mesh.cpp @@ -475,6 +475,11 @@ triangulate: SBsp3 *SBsp3::Insert(STriangle *tr, SMesh *instead) { if(!this) { + if(instead && !(instead->flipNormal)) { + instead->AddTriangle(tr->a, tr->b, tr->c); + return NULL; + } + // Brand new node; so allocate for it, and fill us in. SBsp3 *r = Alloc(); r->n = (tr->Normal()).WithMagnitude(1);