Changeset 418b5e
- Timestamp:
- Mar 27, 2012, 3:53:36 PM (13 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:
- f6ad4d
- Parents:
- cc21cd
- git-author:
- Frederik Heber <heber@…> (03/14/12 16:18:30)
- git-committer:
- Frederik Heber <heber@…> (03/27/12 15:53:36)
- Location:
- src/Tesselation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tesselation/tesselation.cpp
rcc21cd r418b5e 1161 1161 BaseLine = new BoundaryLineSet(); 1162 1162 BaseLine->endpoints[0] = new BoundaryPointSet(MaxPoint[k]); 1163 LOG(0, " Coordinates of start node at " << *BaseLine->endpoints[0]->node << ".");1163 LOG(0, "INFO: Coordinates of start node at " << *BaseLine->endpoints[0]->node << "."); 1164 1164 1165 1165 double ShortestAngle; … … 1174 1174 } 1175 1175 BaseLine->endpoints[1] = new BoundaryPointSet(Temporary); 1176 LOG(1, "INFO: Second node is at " << *Temporary << "."); 1176 1177 1177 1178 // construct center of circle 1178 1179 CircleCenter = 0.5 * ((BaseLine->endpoints[0]->node->getPosition()) + (BaseLine->endpoints[1]->node->getPosition())); 1180 LOG(1, "INFO: CircleCenter is at " << CircleCenter << "."); 1179 1181 1180 1182 // construct normal vector of circle 1181 1183 CirclePlaneNormal = (BaseLine->endpoints[0]->node->getPosition()) - (BaseLine->endpoints[1]->node->getPosition()); 1184 LOG(1, "INFO: CirclePlaneNormal is at " << CirclePlaneNormal << "."); 1182 1185 1183 1186 double radius = CirclePlaneNormal.NormSquared(); … … 1186 1189 NormalVector.ProjectOntoPlane(CirclePlaneNormal); 1187 1190 NormalVector.Normalize(); 1191 LOG(1, "INFO: NormalVector is at " << NormalVector << "."); 1188 1192 ShortestAngle = 2. * M_PI; // This will indicate the quadrant. 1189 1193 … … 1192 1196 1193 1197 // look in one direction of baseline for initial candidate 1194 SearchDirection = Plane(CirclePlaneNormal, NormalVector,0).getNormal(); // whether we look "left" first or "right" first is not important ... 1198 try { 1199 SearchDirection = Plane(CirclePlaneNormal, NormalVector,0).getNormal(); // whether we look "left" first or "right" first is not important ... 1200 } catch(LinearAlgebraException) { 1201 ELOG(1, "Vectors are linear dependent: " 1202 << CirclePlaneNormal << ", " << NormalVector << "."); 1203 delete BaseLine; 1204 continue; 1205 } 1195 1206 1196 1207 // adding point 1 and point 2 and add the line between them -
src/Tesselation/triangleintersectionlist.cpp
rcc21cd r418b5e 113 113 { 114 114 Info FunctionInfo(__func__); 115 TriangleVectorMap::const_iterator runner; 116 runner = GetIteratortoSmallestDistance(); 115 TriangleVectorMap::const_iterator runner = GetIteratortoSmallestDistance(); 117 116 if (runner != IntersectionList.end()) { 118 117 // if we have found one, check Scalarproduct between the vector 119 118 Vector TestVector = (Point) - (*(*runner).second); 120 if (fabs(TestVector.NormSquared()) < MYEPSILON) // 119 LOG(1, "INFO: Distance vector between point " << Point 120 << " and triangle intersection at " << (*(*runner).second) << " is " 121 << TestVector << "."); 122 if (fabs(TestVector.NormSquared()) < MYEPSILON) {// 123 LOG(1, "ACCEPT: Point is on the intersected triangle."); 121 124 return true; 125 } 122 126 const double sign = (*runner).first->NormalVector.ScalarProduct(TestVector); 127 LOG(1, "INFO: Checking sign of SKP between Distance vector and triangle's NormalVector " 128 << (*runner).first->NormalVector << ": " << sign << "."); 123 129 if (sign < 0) { 130 LOG(1, "ACCEPT: Point lies on inner side of intersected triangle."); 124 131 return true; 125 132 } else { 133 LOG(1, "REJECT: Point lies on outer side of intersected triangle."); 126 134 return false; 127 135 } … … 186 194 187 195 // do we have any intersections? 188 TriangleVectorMap::const_iterator runner ;196 TriangleVectorMap::const_iterator runner = IntersectionList.end(); 189 197 if (!DistanceList.empty()) { 190 198 // get closest triangle(s)
Note:
See TracChangeset
for help on using the changeset viewer.