Skip to content

Instantly share code, notes, and snippets.

@VickyTGAW
Created June 9, 2024 12:57
Heart Infill for Slic3r-based Slicers - Python Code for Blender to write output point based on vertices
import bpy
#This script will go through all the vertices in an object and write
#C++ code to be used in Slic3r based settings.
#Replace Heart with the name of your object
obj = bpy.data.objects['Heart']
verts = bpy.data.objects['Heart'].data.vertices
verts_co =[]
for k in range(len(verts)):
adjustedCoord = obj.matrix_world @ verts[k].co;
print('output.add_point({startingx + ', verts[k].co.x, ', startingy + ', verts[k].co.y ,'});')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment