Hi everyone,
I have some I’ve been working on to get contours into speckle and send them as commits. I have made a key named ‘Elevation’ which has each corresponding elevation to its curve. It does show up on the speckle viewer ‘Speckle’. However, I cannot filter by the values.
speckle_contours = []
for feature in topography_data["features"]:
elevation = feature['attributes']['elevation']
geometry = feature["geometry"]
for ring in geometry["paths"]:
points = []
spec_points = []
for coord in ring:
point = rh.Point3d(coord[0], coord[1], 0)
spec_point = point
spec_point = spec_point.Transform(rh.Transform.Translation(spec_translation_vector))
speckle_point = [spec_point.X, spec_point.Y, elevation]
spec_points.append(speckle_point)
points.append(point)
all_points.append(point)
polyline = rh.Polyline(points)
spec_points_flat = [point for sublist in spec_points for point in sublist]
speckle_polyline = Polyline(value=spec_points_flat, closed=False)
speckle_polyline["Elevation"] = elevation
speckle_contours.append(speckle_polyline)
This is how I’m sending the data.
server_transport = ServerTransport(stream_id='16a7ca997a', client=client)
data = speckle_contours
speckle_geometry = speckle_objects.Base(data=data)
object_id = operations.send(
speckle_geometry, transports=[server_transport])
client.commit.create(stream_id='16a7ca997a', object_id=object_id, message=address)
Thanks!