YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

import bpy import math

Clear existing objects

bpy.ops.object.select_all(action='SELECT') bpy.ops.object.delete()

def create_band(radius, width, thickness): bpy.ops.mesh.primitive_cylinder_add( radius=radius, depth=width, vertices=64 ) band = bpy.context.active_object bpy.ops.object.mode_set(mode='EDIT') bpy.ops.mesh.select_all(action='SELECT') bpy.ops.mesh.normals_make_consistent(inside=False) bpy.ops.object.mode_set(mode='OBJECT')

# Create thickness
bpy.ops.object.modifier_add(type='SOLIDIFY')
band.modifiers["Solidify"].thickness = thickness
band.modifiers["Solidify"].offset = 0

return band

def create_component(size, location): bpy.ops.mesh.primitive_cube_add(size=1, location=location) component = bpy.context.active_object component.scale = size return component

Create main band

main_band = create_band(radius=0.1, width=0.15, thickness=0.01) main_band.location = (0, 0, 0)

Create sensor

sensor = create_component(size=(0.02, 0.02, 0.01), location=(0.09, 0, 0))

Create vibration motor

motor = create_component(size=(0.03, 0.03, 0.02), location=(0.09, 0.04, 0))

Create microcontroller

microcontroller = create_component(size=(0.05, 0.05, 0.01), location=(0, 0.09, 0))

Create battery

battery = create_component(size=(0.06, 0.04, 0.02), location=(-0.08, 0.05, 0))

Join all objects

objects_to_join = [main_band, sensor, motor, microcontroller, battery] bpy.ops.object.select_all(action='DESELECT') for obj in objects_to_join: obj.select_set(True) bpy.context.view_layer.objects.active = main_band bpy.ops.object.join()

Add subdivision surface modifier for smoothing

bpy.ops.object.modifier_add(type='SUBSURF') bpy.context.object.modifiers["Subdivision"].render_levels = 2 bpy.context.object.modifiers["Subdivision"].levels = 2

Add material

material = bpy.data.materials.new(name="DeviceMaterial") material.use_nodes = True bpy.context.active_object.data.materials.append(material)

Set up basic color

material.node_tree.nodes["Principled BSDF"].inputs["Base Color"].default_value = (0.8, 0.8, 0.8, 1) # Light gray material.node_tree.nodes["Principled BSDF"].inputs["Roughness"].default_value = 0.3

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support