Does wire.discretize(Number=nb) preserves the shape of curve?

Need help, or want to share a macro? Post here!
Post Reply
stefankorisnik3
Posts: 99
Joined: Sun Jul 24, 2022 12:49 pm

Does wire.discretize(Number=nb) preserves the shape of curve?

Post by stefankorisnik3 »

Can you let me know if the function

Code: Select all

wire.discretize(Number=nb)
guaranty preserving the shape of the wire (closed curve) with increasing the number of vertexes?
More so does and if the

Code: Select all

wire.discretize 
choose in every iteration the longest edge and half it?
User avatar
Roy_043
Veteran
Posts: 5455
Joined: Thu Dec 27, 2018 12:28 pm

Re: Does wire.discretize(Number=nb) preserves the shape of curve?

Post by Roy_043 »

Create a Draft_Rectangle and then run this code:

Code: Select all

doc = App.ActiveDocument
obj = doc.getObject("Rectangle")
wire = obj.Shape.Wires[0]
pts = wire.discretize(30)
import Draft
Draft.make_wire(pts)
Post Reply