compute.rhino3d icon indicating copy to clipboard operation
compute.rhino3d copied to clipboard

How to use HopsMesh for input

Open StuvX opened this issue 2 years ago • 1 comments

Hi there - I am having trouble getting hops to process a mesh, it seems that gh is not passing the mesh to the hops component, any help or guidance is appreciated.

python file is as follows.

@hops.component(
    "/meshInOut",
    name="meshInOut",
    description="randomly shift mesh vertices",
    inputs=[
        hs.HopsMesh("MeshIn", "M_i", "Mesh to be shifted")
        hs.HopsNumber("Shift", "s", "distance of shift", default=2.0),
    ],
    outputs = [
        hs.HopsMesh("MeshOut", "M_o", "Shifted Mesh"),
    ],
)
def meshInOut(msh: r3.Mesh, s):
    print((msh))
    for v in msh.Vertices:
        v += np.random.random(3)*s
    msh_out = msh
    return msh_out

if __name__== "__main__":
    app.run()

StuvX avatar Dec 28 '22 00:12 StuvX

See: https://discourse.mcneel.com/t/how-to-pass-mesh-to-hops/152611 The ghhops-server currently doesn't support communicating with Rhino 8.

sbaer avatar Jan 05 '23 02:01 sbaer