In another thread regarding sortEdges I described an effort to try to round vertex values:
viewtopic.php?p=684338#p684338
It turns out that the TopoShapes are read-only so there would need to be some gymnastics to deal with that.
in trying to explore that using the distToShape function that was very helpfully pointed out, I came across the fixTolerance function for the same type of objects. At a glance of the doc, e.g.
Code: Select all
help(Part.Edge.fixTolerance)
Can someone point me to an example of the use of fixTolerance and tell me what the parameter for getPoints is?
In the case of the latter, it only seems to take an integer, but I don't know what the significance of the number is.
In the case of former, if I start out with an edge and use getPoints, I get what I assume are the points making this line up:
Code: Select all
test=Part.Edge(Part.Vertex(1.2345,2.345,3.456),Part.Vertex(4.567,5.467,7.234))
test.getPoints(1)
Code: Select all
([Vector (1.2345, 2.345, 3.456), Vector (1.7967863157106727, 2.871769055558506, 4.09345467389495), Vector (2.3590726314213457, 3.3985381111170114, 4.7309093477899005), Vector (2.9213589471320187, 3.925307166675517, 5.368364021684851), Vector (3.4836452628426917, 4.452076222234023, 6.005818695579801), Vector (4.045931578553365, 4.978845277792528, 6.643273369474752), Vector (4.567, 5.466999999999999, 7.234)], [])
Code: Select all
test.fixTolerance(0.1,Part.Edge) #also takes Part.Vertex, Part.Face, Part.Wire; but not "other value" as stated in doc
What is the expected function of fixTolerance?
(FWIW, the use case is having created a line and an arc, the arc endpoints need to be adjusted to be close to or match the endpoint of a given line. Maybe I'm going about this all wrong. If that's the thought, any advise would be welcome.)
TIA,
mconsidine