### pad a shape ```python def padShape(shape_to_pad): ## create the Body object and then a Feaure object inside it called 'Base Feature' #newBody = doc.addObject('PartDesign::Body','Loop for cable ID ' + str(cable_ID)) base_feature = doc.addObject('PartDesign::Feature','Base Feature') ## the shape object that was given to this function is assigned to the base feature object base_feature.Shape = shape_to_pad ## create a new Pad object - this will be the 3D object newPad = doc.addObject('PartDesign::Pad','Padding') ## pad options: the profile (base feature, the outline of the loop) is padded by clip_height in the z direction newPad.Profile = base_feature newPad.Length = clip_height doc.recompute() return newPad ``` ### segments to wires ```python def toWires(segments): ## helper function for turning a list of Edge objects into a list of Wire objects wires = [] for segment in segments: wires.append(segment.toShape()) return Part.Wire(wires) ```