| 
						
						
							
								
							
						
						
					 | 
					@ -113,15 +113,20 @@ bool keepQuadraturePoint(const std::vector<tensor3>& tensors, const OcTreeNode& | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    // 只需要考虑intersect polys,不用考虑fully contained polys
 | 
					 | 
					 | 
					    // 只需要考虑intersect polys,不用考虑fully contained polys
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    const auto& polyIntersectIndices = ocTreeNode.polyIntersectIndices; | 
					 | 
					 | 
					    const auto& polyIntersectIndices = ocTreeNode.polyIntersectIndices; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    assert(tensors.size() == polyIntersectIndices.size()); | 
					 | 
					 | 
					    assert(tensors.size() == polyIntersectIndices.size()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    if (polyIntersectIndices.size() == 0) { | 
					 | 
					 | 
					    // if (polyIntersectIndices.size() == 0) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        assert(ocTreeNode.blobTree.structure.back().inOut != NODE_IN_OUT_UNKNOWN); | 
					 | 
					 | 
					    //     assert(ocTreeNode.blobTree.structure.back().inOut != NODE_IN_OUT_UNKNOWN);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        return ocTreeNode.blobTree.structure.back().inOut; | 
					 | 
					 | 
					    //     return ocTreeNode.blobTree.structure.back().inOut == organizer::NODE_IN;
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					    } | 
					 | 
					 | 
					    // }
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					    std::vector<bool> primitiveInOuts(polyIntersectIndices.size()); | 
					 | 
					 | 
					    std::vector<char> primitiveInOuts(polyIntersectIndices.size()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					    for (int i = 0; i < ocTreeNode.polyIntersectIndices.size(); ++i) { | 
					 | 
					 | 
					    for (int i = 0; i < ocTreeNode.polyIntersectIndices.size(); ++i) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        // primitiveInOuts[i] = isInsidePowers(scene.polys[polyIntersectIndices[i]].rawPower, originPt);
 | 
					 | 
					 | 
					        // primitiveInOuts[i] = isInsidePowers(scene.polys[polyIntersectIndices[i]].rawPower, originPt);
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        primitiveInOuts[i] = isInsideBernstein(tensors[i], point); | 
					 | 
					 | 
					        primitiveInOuts[i] = isInsideBernstein(tensors[i], point); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    if (primitiveInOuts.size() == 3 && primitiveInOuts[0] == NODE_IN && primitiveInOuts[1] == NODE_IN | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        && primitiveInOuts[2] == NODE_IN) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        int aaa = 1; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        int bbb = 1; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    // 这里blobTree是拷贝传参
 | 
					 | 
					 | 
					    // 这里blobTree是拷贝传参
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    auto blobTree = ocTreeNode.blobTree; | 
					 | 
					 | 
					    auto blobTree = ocTreeNode.blobTree; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    int  res      = organizer::traverse(blobTree, ocTreeNode.polyIntersectIndices, primitiveInOuts); | 
					 | 
					 | 
					    int  res      = organizer::traverse(blobTree, ocTreeNode.polyIntersectIndices, primitiveInOuts); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -615,15 +620,15 @@ void quadratureScene(const std::vector<std::shared_ptr<PrimitiveDesc>>& primitiv | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    for (int i = 0; i < minimalReps.size(); ++i) { rootNode.polyIntersectIndices.emplace_back(i); } | 
					 | 
					 | 
					    for (int i = 0; i < minimalReps.size(); ++i) { rootNode.polyIntersectIndices.emplace_back(i); } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    int cnt = 1; | 
					 | 
					 | 
					    int cnt = 1; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    buildOcTreeV0(scene, rootNode, leaves, 1, cnt); | 
					 | 
					 | 
					    buildOcTreeV0(scene, rootNode, leaves, 1, cnt); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					
 | 
					 | 
					 | 
					    std::cout << "octree built over" << std::endl; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					    basicTask(scene, leaves[14], q); | 
					 | 
					 | 
					    // basicTask(scene, leaves[14], q);
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    int i = 0; | 
					 | 
					 | 
					    int i = 0; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    for (const auto& leaf : leaves) { | 
					 | 
					 | 
					    for (const auto& leaf : leaves) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        auto basicRes = basicTask(scene, leaf, q); | 
					 | 
					 | 
					        auto basicRes = basicTask(scene, leaf, q); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        if (std::isinf(basicRes.volume)) { std::cout << "inf volume when solving leaf: " << i << std::endl; } | 
					 | 
					 | 
					        if (std::isinf(basicRes.volume)) { std::cout << "inf volume when solving leaf: " << i << std::endl; } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        volume += basicRes.volume; | 
					 | 
					 | 
					        volume += basicRes.volume; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        std::cout << "Solved leaves: " << ++i << "/" << leaves.size() << std::endl; | 
					 | 
					 | 
					        std::cout << "Solved leaves: " << ++i << "/" << leaves.size() << ", volume: " << volume << std::endl; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    volume *= prod(xmax - xmin); | 
					 | 
					 | 
					    volume *= prod(xmax - xmin); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |