Shape Tester. What we need? 1) Tests: a)Test individual shapes Correctness and consistency(like original SBT test, OpticalEscape, ShapeChecker) Accuracy(precision.

Slides:



Advertisements
Similar presentations
Hypothesis testing Another judgment method of sampling data.
Advertisements

Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Created by Stephanie Ingle Kingwood High School
BBS514 Structured Programming (Yapısal Programlama)1 Functions and Structured Programming.
Chapter 31 Images.
Chapter 23 Mirrors and Lenses.
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
Grab Bag Wave Vocabulary Mirrors Light, Mirror, and Lens Lenses
Reflection Light incident upon a boundary between
Chapter 23 Mirrors and Lenses. Notation for Mirrors and Lenses The object distance is the distance from the object to the mirror or lens Denoted by p.
Reflection and Refraction of Light
Chapter 23 Mirrors and Lenses.
Light: Geometric Optics
Light and Reflection Level 1 Physics. Facts about Light It is a form of Electromagnetic Energy It is a part of the Electromagnetic Spectrum and the only.
© 2014 Pearson Education, Inc. This work is protected by United States copyright laws and is provided solely for the use of instructors in teaching their.
Chapter 11 Review Mirrors & Lenses. What is an angle of incidence? 2 The angle between an incident ray and the normal of an optical device. Category:
Chapter 23 Mirrors and Lenses.
Curved Mirrors and Ray Diagrams SNC2D. Concave Mirrors A concave mirror is a curved mirror with the reflecting surface on the inside of the curve. The.
2.1 Integers and Absolute Value
Data Types. Every program must deal with data The data is usually described as a certain type This type determines what you can do with the data and how.
Cornell CS465 Fall 2004 Lecture 3© 2004 Steve Marschner 1 Ray Tracing CS 465 Lecture 3.
Cornell CS465 Fall 2004 Lecture 3© 2004 Steve Marschner 1 Ray Tracing CS 465 Lecture 3.
© 2005 Pearson Prentice Hall This work is protected by United States copyright laws and is provided solely for the use of instructors in teaching their.
Introduction to Ray Diagrams How to draw them for Curved Mirrors (please view this slide show in presentation view by pressing F5)
Chapter 23 Mirrors and Lenses.
Mirrors & Reflection.
U-Solids: new geometrical primitives library for Geant4 and ROOT Marek Gayer CERN Physics Department (PH) Group Software Development for Experiments (SFT)
Scientific Notation. What is scientific notation? Scientific notation is a way of expressing really big numbers or really small numbers. It is most often.
USolids meeting Conventions. DistanceToIn(p,v) Geant4USolidsVecGeomROOT Point p is Outside No intersection Between shape and ray(p+v*t) Infinity.
Comparing two sample means Dr David Field. Comparing two samples Researchers often begin with a hypothesis that two sample means will be different from.
Light wave Recall: Light must reflect off of an object before it can be used to see the object. A flat mirror is called a plane mirror. A plane mirror.
1 Electric Field – Continuous Charge Distribution As the average separation between source charges is smaller than the distance between the charges and.
CH2 – Using Data. Constant Something which cannot be changed Data Type Format and size of a data item Intrinsic Data Types Pg. 47 – Table 2-1 Basic ones.
1.1 EXPLORING STATISTICAL QUESTIONS Unit 1 Data Displays and Number Systems.
Week 13 - Monday.  What did we talk about last time?  Exam 2!  Before that…  Polygonal techniques ▪ Tessellation and triangulation  Triangle strips,
Light and Reflection Curved Mirrors. Concave Spherical Mirrors Concave spherical mirror – an inwardly curved, spherical mirrored surface that is a portion.
Physics: Principles with Applications, 6th edition
10-8 Areas and Volumes of Similar Solids
New software library of geometrical primitives for modelling of solids used in Monte Carlo detector simulations Marek Gayer, John Apostolakis, Gabriele.
1 Dr. Scott Schaefer Intersecting Simple Surfaces.
Number System. Do not train children to learning by force and harshness, but direct them to it by what amuses their minds, so that you may be better able.
Its now time to see the light…..  A lens is a curved transparent material that is smooth and regularly shaped so that when light strikes it, the light.
Copyright © 2014 by McGraw-Hill Higher Education. All rights reserved. Essentials of Business Statistics: Communicating with Numbers By Sanjiv Jaggia and.
Module 1: Measurements & Error Analysis Measurement usually takes one of the following forms especially in industries: Physical dimension of an object.
Detector Description – Part III Ivana Hrivnacova, IPN Orsay Tatiana Nikitina, CERN Aknowledgement: Slides by: J.Apostolakis, G.Cosmo, A. Lechner.
Computer Graphics Basic Maths for Graphics in C++ CO2409 Computer Graphics Week 4.
Outline  Developments/fixes in the last year  Introduced in release 9.6 and patches  Planned for release 10.0 and ongoing …  Currently under development.
U-Solids: new geometrical primitives library for Geant4 and ROOT Marek Gayer CERN Physics Department (PH) Group Software Development for Experiments (SFT)
Higher Dimensions. x Let's say we use a pencil to mark a point on paper. x is this point. We pick a direction and move the pencil along this direction.
Today 2/10  Multiple Lens Systems 26.9  Curved Mirrors  Lab: Mirrors and Thin Lenses  HW:“2/10 Two Lenses” Due Thursday 2/12  Exam IThursday,
Algorithms, Part 3 of 3 Topics In-Class Project: The Box
Mirrors. Mirrors and Images (p 276) Light travels in straight lines, this is the reason shadows and images are produced (p 277) Real images are images.
Reflection Regular reflection occurs when parallel light rays strike a smooth surface and reflect in the same direction. Diffuse reflection occurs when.
Drawing Ray Diagrams for Plane Mirrors
Reflection Regular reflection occurs when parallel light rays strike a smooth surface and reflect in the same direction. Diffuse reflection occurs when.
A light beam striking a boundary between two media can be partly transmitted and partly reflected at the boundary.
Solid Modeling Dr. Scott Schaefer.
Part 10 Optics --Mirrors and Lenses Chapter 24 Geometric Optics.
Refraction of light pg. 77.
Basics Reflection Mirrors Plane mirrors Spherical mirrors Concave mirrors Convex mirrors Refraction Lenses Concave lenses Convex lenses.
Geometrical Optics.
Lesson Plan: Drafting and Design J6-2. What is 3D solid modeling? How do 3D solid modeling programs work?
Copyright © 2014, 2010, 2007 Pearson Education, Inc.
Computer Graphics Basic Maths for Graphics in C++
Confidence Intervals and Sample Size
Simulation-Based Approach for Comparing Two Means
Copyright © 2014, 2010, 2007 Pearson Education, Inc.
SIMILAR POLYGONS Two figures are similar if
Copyright © 2014, 2010, 2007 Pearson Education, Inc.
CSE 1020:Software Development
Presentation transcript:

Shape Tester. What we need? 1) Tests: a)Test individual shapes Correctness and consistency(like original SBT test, OpticalEscape, ShapeChecker) Accuracy(precision of methods, like for DistanceToIn() in SurfaceChecker) b)Comparison between different packages (unified SBT) Performance Comparison of values 2) For testing we need to generate points and directions and store them for performance test. 3) Report results of the tests with possibility to store some values b)Correctness, in case of error store point,direction,value of difference c)Accuracy, report accuracy per method, some staistics a)Time per package and differences per package Should standardize the output of the tests in order to be able to visualize them with a single program. 4) In addition we need Unit Test with 'asserts' for each shape. 5)Automatisation of part of testing suite for regular use

What we use/need : Points : Inside, created randomly by using existing Extent() and verify that points are really Inside by using Inside(). Outside, created randomly by using given dimensions of World Bounds and verify that points are really Outside by using Inside(). Surface, GetPointOnSurface() already implemented for all USolids. Edges, GetPointsOnEdges() will be implemented for all USolids. Directions: Random, created randomly directions using angles phi and theta. Random specifics, ensuring that ray will go Inside/Outside/Surface/Edge. Random with reflection(or going back) for Optical Escape test. We want to be able to use different proportions for different methods or tests. Shape Tester. Generation of test rays.

CreatePointsInside(const int n, const double r, UVector3 &points ); CreatePointsOutside(const int n, const double r, UVector3 &points ); //r = dimensions of bounds CreatePointsOnSurface(const int n, UVector3 &points ); CreatePointsOnEdges(const int n, UVector3 &points ); CreateRandomDirections(const int n, UVector3 &directions); CreateSpecificDirections(const int n, const int state, UVector3 &directions); //State = Test Ray going Inside/Outside/Surface/Edge of shape (enum?) Shape Tester.Generation of test rays.

bool TestMethod(n,parametersPoints,parametersDirections, verbose) { points = CreatePoints(n,parametersPoints); directions = CreateDirections(n,parameterDirections); //if needed debug = InitializeDebugger(); for (int i = 0; i < n; i++) TestOnePoint (i,points, directions, verbose, debug); ReportErrors (verbose, debug); } n = number of points to test parametersPoints = percentage of Points generated Inside/Outside/Surface/Edge parametersDirections = percentage of Directions pointing Inside/Outside/Surface/Edge verbose = level of verbose: 0=just report minimum information(how many errors are found) n=store and report results, n defines how many errors we want to store and report debug = pointer to stored values of errors for each error store :specification of the error, point,direction, value, value expected, number of stored points depend on verbose parameter Shape Tester. Individual methods.

% SBT logged output Thu Mar 13 11:42: % /solid/G4Polycone (-6781,-6735,-6735,-6530,-6530,-4185,-4185,-3475,- 3475,3475,3475,4185,4185,6530,6530,6735,6735,6781) (41,41,41,41,41,41,120,120,1148,1148,120,120,41,41,41,41,41,41) (415,415,3275,3275,4251,4251,4251,4251,4251,4251,4251,4251,4251,4251,3275,3275,415,415) % maxPoints = % maxErrors = 100 % End of test (maximum number points) Thu Mar 13 11:42: % Statistics: points=10000 errors=0 errors reported=0 % inside=5217 outside=4783 surface=0 % cpu time=11 %(End of file) Example of debug output: Method InsidePoins() :points tested= 10000,errors found = 100, errors reported =1 Point1:'point not inside', point=(1,1,1), value=eSurface, expected=eInside Shape Tester. Example of output.

1)Tests of correctness of the answer of main methods for points Inside,Outside or on the Surface/Edge. This test can be used together with unit tests for automatized test of library. t estPointsInside(n,parametersPoints,parametersDirections, verbose) testPointsOutside(n,parametersPoints,parametersDirections, verbose) testPointsOnSurface(n,parametersPoints,parametersDirections, verbose) 2)Test of correctness and accuracy of one method.Test can give some statistics about precision of the methods, store values for histograms. Will include tests for 'far away' and 'close by' points. testDistanceToIn(n,parametersPoints,parametersDirections, verbose, dist) testDistanceToOut(n,parametersPoints,parametersDirections, verbose,dist) double dist = dist from which we will shoot rays testSafety(n,parametersPoints,parametersDirections, verbose,nSphere, precise, useDistanceToIn) int nSphere =how many points use for test“Safety Sphere” bool precise = precise or not precise Safety bool useDistanceToIn = compare or not with DistanceToIn testNormal (n,parametersPoints, verbose,nReflections) test similar to Optical Escape nReflections = number of Reflections per point testVoxels(n,parametersPoints, verbose) testConvexity(?, this test not exist yet, exist only comparison of the packages) Shape Tester. Individual Shape Tests.

Consider pair of points, one inside and one outside the solid Select direction versus inside Must be DistanceToIn() < infinity (and less the distance between the two points) Compute SafetyFromOutside() (d1), cannot be bigger than DistanceToIn() Propagate to surface by d1, and compute Inside(); it must give 'kSurface', otherwise report overshoot or undershoot Compute SafetyFromIn(), must be zero Compute DistanceToOut(), should not be zero and be smaller than the extent along that direction Compute DistanceToIn(), has to be zero Invert direction (towards outside) Compute SafetyFromOutside(), must be zero Compute DistanceToIn(), must be greater than zero Compute DistanceToOut(), must be zero Compare the computed normals and make the dot product with direction, must be negative Shape Tester. Example.TestOutsidePoints().

Shape Tester. Example.TestSafety(). Generate random points inside 2*BoundingBox Compute Safety() for each of them and generate random directions Move by Safety-tolerance and calculate Inside() for new point and for original point, calculated values of Inside have to be the same If demanded in test, for each point and direction, compute the distance to the solid (DistanceToIn() or DistanceToOut() depending on Inside() result) Compare the distance to the value of the safety; must be distance > safety Store found differences

Shape Tester. Example.TestNormal(). Generate random points inside the solid and random directions for each of them For each propagate by DistToOut() to surface and reflect randomly so that (norm).(dir)<0 and compute DistToOut() DistToOut() must never be zero Corners and edges will be most exercised Shape Tester. Example.AccuracyTest(). Accuracy test for DistanceToIn/Out() Generate random points in the world (may be inside or outside the solid) Generate random point on surface Calculate DistanceToIn() from any point outside in direction to the point on surface, taking care of multiple intersections Compute numerical error comparing to the real distance, store results Same for points inside the solid for DistanceToOut()

Comparison of performance and values with different packages. Will be nice to have it also, may be in different place? To have comparison directly in 'ShapeTester': -We need to create corresponding shapes in different package -We need to store points and directions for performance comparison: bool TestMethod(n,parametersPoints,parametersDirections, verbose, shape, package) { points = CreatePoints(n,parametersPoints); directions = CreateDirections(n,parameterDirections); //if needed SetupShape(shape,package); storing = InitializeStoring(); //storing differences TestMethod (n,points, directions, verbose, storing); ReportTime(); ReportDifferences(verbose, storing); } Shape Tester. Comparison.