File: profile_rayintersection.py

package info (click to toggle)
uranium 5.0.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,304 kB
  • sloc: python: 31,765; sh: 132; makefile: 12
file content (16 lines) | stat: -rw-r--r-- 416 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the LGPLv3 or higher.

from UM.Math.AxisAlignedBox import AxisAlignedBox
from UM.Math.Ray import Ray
from UM.Math.Vector import Vector

@profile
def intersects(box, ray):
    return box.intersectsRay(ray)

ray = Ray(Vector(10, 10, 10), Vector(-1, -1, -1))
box = AxisAlignedBox(10, 10, 10)

for i in range(100000):
    intersects(box, ray)