Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

What's the best way to prevent a newly inserted point from merging-with or becoming coincident to an existing point?

OceanHydroAU
Collaborator

What's the best way to prevent a newly inserted point from merging-with or becoming coincident to an existing point?

OceanHydroAU
Collaborator
Collaborator

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:

Screen Shot 2020-11-25 at 4.25.18 pm.png

Here's what I want:

Screen Shot 2020-11-25 at 4.27.05 pm.png

I got the above by first creating it like this (extreme close-up)

Screen Shot 2020-11-25 at 4.26.33 pm.png

Then manually moving those points, here's me half-way to that goal:-

Screen Shot 2020-11-25 at 4.26.49 pm.png

And the goal:-

Screen Shot 2020-11-25 at 4.26.57 pm.png

 

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.

0 Likes
Reply
222 Views
1 Reply
Reply (1)

OceanHydroAU
Collaborator
Collaborator

Update: that idea does not seem to work in 3D, mangles the "planarness" of the spline.

0 Likes