What's the best way to prevent a newly inserted point from merging-with or becoming coincident to an existing point?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm wanting a spline to join back to itself with a pointy end, not a loop, but it seems that when I create the two end points on top of each other, they're being "merged" or "constrained" in some way that messes up my goal.
Is there some convention to prevent that behaviour? The "hack" would be to create the points someplace else, then move it - however - that's simply russian-roulette - I still need to "hope" that whatever "other place" I pick does not already have a point on it either... and worse - if it *does* have a point, the "move" concept fails (doesn't happen, or breaks the model) if the point that was already there had constraints.
Here's the unwanted rounded end:
Here's what I want:
I got the above by first creating it like this (extreme close-up)
Then manually moving those points, here's me half-way to that goal:-
And the goal:-
Update... after typing the above, I just tried all the following:-
# Try to create first, then move:-
point=adsk.core.Point3D.create( ) # no xyz to avoid constraint adding
point=adsk.core.Point3D.create( 0,0,0 )
point.set( *xyz ) # fails - becomes co-incident again
point.translateBy( adsk.core.Vector3D.create( *xyz )) # fails - becomes co-incident again
# Create first, then move out of the way
point=adsk.core.Point3D.create( *xyz ) # caution - seems to auto-add constraints
point.translateBy( adsk.core.Vector3D.create( -1,-1,0 ))
# ... do my work ...
point.translateBy( adsk.core.Vector3D.create( 1,1,0 )) # move it back - fails - becomes co-incident again
so all those ideas failed. Finally - I tried this, which did at last work!
points[0].translateBy( adsk.core.Vector3D.create( -1,-1,0 )) # prevent co-incidence...
foilobj=sketch.sketchCurves.sketchFittedSplines.add(points) # Caution: auto-joins coincident starting+ending points
points[0].translateBy( adsk.core.Vector3D.create( 1,1,0 )) # put the point back
foilobj.startSketchPoint.move( adsk.core.Vector3D.create( 1,1,0 )) # fix the spline too
So it looks like my problem was probably not with the points themselves, but the spline creation...
I worry a lot about this "breaking stuff" when using 3D points (like the shape not staying planar) and my random 1cm shift running into other things... but for now, I'll post this here in case future people have this same issue.