Skip to content

Commit ccbe2f9

Browse files
authored
Update README.md
1 parent 4424b20 commit ccbe2f9

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
11
# RayCaster.jl
22

3+
[![Build Status](https://github.com/JuliaGeometry/RayCaster.jl/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/JuliaGeometry/RayCaster.jl/actions/workflows/ci.yml?query=branch%3Amaster)
4+
[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://juliageometry.github.io/RayCaster.jl/stable/)
5+
[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://juliageometry.github.io/RayCaster.jl/dev/)
6+
37
Performant ray intersection engine for CPU and GPU.
8+
9+
## Getting Started
10+
11+
To get started with RayCaster.jl, first add the package to your Julia environment:
12+
13+
```julia
14+
using Pkg
15+
Pkg.add("RayCaster")
16+
```
17+
18+
Then you can create a basic ray intersection scene:
19+
20+
```julia
21+
using RayCaster, GeometryBasics, LinearAlgebra
22+
23+
# Create some simple spheres
24+
function LowSphere(radius, contact=Point3f(0); ntriangles=10)
25+
return Tesselation(Sphere(contact .+ Point3f(0, 0, radius), radius), ntriangles)
26+
end
27+
28+
# Build a scene with multiple objects
29+
s1 = LowSphere(0.5f0, Point3f(-0.5, 0.0, 0); ntriangles=10)
30+
s2 = LowSphere(0.3f0, Point3f(1, 0.5, 0); ntriangles=10)
31+
32+
# Create BVH acceleration structure
33+
bvh = RayCaster.BVHAccel([s1, s2])
34+
35+
# Perform ray-scene intersections
36+
viewdir = normalize(Vec3f(0, 0, -1))
37+
hitpoints, centroid = RayCaster.get_centroid(bvh, viewdir)
38+
```
39+
40+
## Documentation
41+
42+
For detailed examples and API documentation, see the [full documentation](https://juliageometry.github.io/RayCaster.jl/).

0 commit comments

Comments
 (0)