Changeset 2130dd
- Timestamp:
- Nov 28, 2009, 3:48:41 PM (15 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 73b510
- Parents:
- af374d (diff), 856098 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tesselation.cpp
raf374d r2130dd 4132 4132 /// 2. Go through all lines not contained in degenerated triangles. 4133 4133 UniquePolygonSet ListofFours; 4134 UniquePolygonSet TestedPolygons; 4134 4135 for (LineMap::const_iterator LineRunner = LinesOnBoundary.begin(); LineRunner != LinesOnBoundary.end(); LineRunner++) { 4135 4136 Log() << Verbose(1) << "Current Line is: " << *(LineRunner->second) << endl; … … 4148 4149 TriangleSet *T = Four->GetAllContainedTrianglesFromEndpoints(); 4149 4150 4150 /// 2c. check whether triangles are not already simply degenerated. 4151 /// 2c1. Check whether all triangles have (besides sign) same normal vector) 4152 TriangleSet::const_iterator Runner = T->begin(); 4153 Vector NormalVector; 4154 NormalVector.CopyVector(&(*Runner)->NormalVector); 4155 Runner++; 4156 bool IsPlanar = true; 4157 for (; Runner != T->end(); Runner++) { 4158 if (fabs(fabs(NormalVector.ScalarProduct(&(*Runner)->NormalVector)) - 1.) > MYEPSILON) // check whether all NormalVectors are parallel 4159 IsPlanar = false; 4160 } 4161 4162 /// 2c2. check whether triangles are not already simply degenerated. 4151 4163 size_t DegeneratedCount = 0; 4152 4164 for (TriangleSet::const_iterator Runner = T->begin(); Runner != T->end(); Runner++) { … … 4155 4167 } 4156 4168 Log() << Verbose(1) << "Found " << DegeneratedCount << " degenerated triangles." << endl; 4157 if (DegeneratedCount == 0) { 4158 /// 2c. Find all pairs of those triangles that contain the four endpoints 4159 const int counter = CountTrianglePairContainingPolygon(Four, T); 4160 Log() << Verbose(1) << "There are " << counter << " pairs for this polygon of four." << endl; 4161 if (counter %3 == 0) { 4162 /// 2d. Check the number of pairs, if greater 1, we have a degenerated polygon (mark down for later use) 4163 pair < UniquePolygonSet::iterator, bool > Tester = ListofFours.insert(Four); 4164 if (Tester.second) { 4165 Log() << Verbose(0) << "ACCEPT: We have a degenerated polygon." << *Four << endl; 4169 4170 if (IsPlanar) { 4171 if(DegeneratedCount == 0) { 4172 /// 2c. Find all pairs of those triangles that contain the four endpoints 4173 const int counter = CountTrianglePairContainingPolygon(Four, T); 4174 Log() << Verbose(1) << "There are " << counter << " pairs for this polygon of four." << endl; 4175 if (counter %3 == 0) { 4176 /// 2d. Check the number of pairs, if greater 1, we have a degenerated polygon (mark down for later use) 4177 pair < UniquePolygonSet::iterator, bool > Tester = ListofFours.insert(Four); 4178 if (Tester.second) { 4179 Log() << Verbose(0) << "ACCEPT: We have a degenerated polygon." << *Four << endl; 4180 } else { 4181 Log() << Verbose(0) << "REJECT: Degenerated polygon already present." << *Four << endl; 4182 delete(Four); 4183 } 4166 4184 } else { 4167 Log() << Verbose(0) << "REJECT: Degenerated polygon already present." << *Four << endl;4185 Log() << Verbose(0) << "REJECT: Seems to be the edge line of a degenerated polygon only." << *Four << endl; 4168 4186 delete(Four); 4169 4187 } 4170 4188 } else { 4171 Log() << Verbose(0) << "REJECT: Seems to be the edge line of a degenerated polygon only." << *Four<< endl;4189 Log() << Verbose(0) << "REJECT: This polygon contains some simply degenerated triangles." << endl; 4172 4190 delete(Four); 4173 4191 } 4174 4192 } else { 4175 Log() << Verbose(0) << "REJECT: This polygon contains some simply degenerated triangles." << endl;4193 Log() << Verbose(0) << "REJECT: This polygon does not lay on a plane." << endl; 4176 4194 delete(Four); 4177 4195 }
Note:
See TracChangeset
for help on using the changeset viewer.