Skip to content

I met with erratic results #5

@zb12138

Description

@zb12138

I encounter unstable results when I run Python code. Is there any randomness to this method?
This is my code:

import numpy as np
from pysdf import SDF
import trimesh
o = trimesh.load('aa.obj')
o.vertices = o.vertices - o.vertices.min()
resolution = 100

tick = np.expand_dims(np.linspace((o.vertices).min(),(o.vertices).max(),resolution),1)
[x,y,z] = np.meshgrid(tick,tick,tick)
queryPoint = np.c_[x.reshape(-1),y.reshape(-1),z.reshape(-1)]

f = SDF(o.vertices, o.faces)
sdf0 = f(queryPoint)
f1 = SDF(o.vertices, o.faces)
sdf1 = f1(queryPoint)
print((sdf0 - sdf1).max())

environment:
Intel(R) Core(TM) i5-9500 CPU; Windows 10; pyhton 3.7.9; No GPUs

expected output: 0
actual output: 37.03153 (stochastic)

Can you provide a method without randomness? Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions