> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ntop.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

This walkthrough runs every `ntop.core` operation in sequence against a single loaded body. See the [API Reference](/Product-Documentation/ntop-core/python-package/api-reference) for full parameter and return details on any call.

```python theme={null}
import numpy as np
from ntop import core
from ntop.core import Frame

body = core.load("assets/delta.implicit")
print(body)
```

## Bounding box

`bounding_box` is a live property: it queries the engine on every access rather than returning a cached snapshot. It's also a convenient source of sizes to scale the rest of the walkthrough to this body's extent.

```python theme={null}
bb = body.bounding_box
print("min", bb.min)
print("max", bb.max)
print("center", bb.center)
print("diagonal", bb.diagonal)

diag = np.linalg.norm(bb.diagonal)
feature_size = spacing = float(diag / 60)
```

## Field and gradient

```python theme={null}
pts = np.array([bb.center, bb.min, bb.max])
values = body.field(pts)  # negative inside, positive outside

g = body.gradient(pts)
print("gradient norms", np.linalg.norm(g.gradient, axis=1))  # ≈ 1 away from the medial axis
```

## Mesh, voxelize, slice, rasterize

```python theme={null}
vertices, faces = body.mesh(feature_size=feature_size)

grid = body.voxelize(spacing=spacing / 5)
print(grid.shape, grid.dtype, "inside voxels:", grid.sum())

contours = body.slice(float(bb.center[2]), feature_size=feature_size)
print(f"{len(contours)} contour(s) at z={bb.center[2]:.3f}")

mask = body.rasterize(spacing=spacing / 10)
print(f"rasterize: {mask.shape}, {mask.sum()} inside pixels")
```

## Transform and scale

Both return a **new** body; the original is untouched.

```python theme={null}
shift = np.array([2.0, 0.0, 0.0])
frame = Frame(origin=-shift, x_axis=np.array([1.0, 0.0, 0.0]), y_axis=np.array([0.0, 1.0, 0.0]))
moved = body.transform(frame)

scaled = body.scale(np.array([2.0, 2.0, 2.0]), bb.center)
```

## Closest point and interval

```python theme={null}
rng = np.random.default_rng(0)
query = rng.uniform(bb.min, bb.max, (200, 3))
projected, out_of_tol = body.closest_point(query, tolerance=1e-4)
print(f"{len(out_of_tol)} / {len(query)} points did not converge")

lo, hi = body.interval(bb)
print(f"field bounds over the full bounding box: [{lo:.3f}, {hi:.3f}]")
```

## Save and reload

```python theme={null}
import pathlib
import tempfile

tmp_path = pathlib.Path(tempfile.gettempdir()) / "delta_copy.implicit"
body.save(tmp_path)
reloaded = core.load(tmp_path)
print("bbox matches:", np.allclose(reloaded.bounding_box.diagonal, bb.diagonal))
tmp_path.unlink()
```

## Context manager

Use `with` for deterministic handle release instead of waiting on the garbage collector:

```python theme={null}
with core.load("assets/delta.implicit") as b:
    print(b.field(bb.center))
# handle released automatically here
```

## Next steps

* The [API Reference](/Product-Documentation/ntop-core/python-package/api-reference) documents every method's parameters, return shapes, and exceptions in full, including concrete examples of each error.
