Vertex Snap Problem - Solved Somewhat

NHHiker
Advocate
Advocate

Vertex Snap Problem - Solved Somewhat

NHHiker
Advocate
Advocate

I have a very basic survey of about 50 vertex points onto which I build 3D faces. I convert the point cloud to an editable mesh to start, but then I've had a problem with the Vertex Snap option in the past and wasn't sure where the inconsistency was coming up. Basically, the snap function simply did nothing. In building the faces, the vertices I was placing weren't snapping correctly.

 

I recently found this: The very first face I try to build does NOT snap to the vertices correctly. However, every subsequent face does. The solution for me is to simply draw a dummy face off to the side of the model area, then begin drawing the faces I want. After I get started, I can delete the dummy face.

 

HTH,

John

______________________________________________________________________
Windows 10 Pro, Intel Xeon E5-2630v4, 48GB, NVIDIA Quadro M4000
0 Likes
Reply
Accepted solutions (3)
6,176 Views
13 Replies
Replies (13)

patrick.schock
Autodesk Support
Autodesk Support

Hello @NHHiker,

thanks for posting your workaround for snapping vertices. I will investigate if this behavior will be fixed in a later version of 3ds Max. I also found this script, which also works in 3ds Max 2019: Snap!

 

Maybe the script can be helpful too...

 

Looking forward to your reply, if this could be an alternative to the workflow you explored.

 

Best regards,

Patrick

“https://damassets.autodesk.net/content/dam/autodesk/logos/autodesk-logo-primary-rgb-black-small_forum.png”
0 Likes

patrick.schock
Autodesk Support
Autodesk Support

Hello @NHHiker,

 

I just wanted to follow up and ask if the script from my last post was helpful for you? Looking forward to your reply!

 

Best regards,

Patrick

 

“https://damassets.autodesk.net/content/dam/autodesk/logos/autodesk-logo-primary-rgb-black-small_forum.png”
0 Likes

NHHiker
Advocate
Advocate

@patrick.schock,

 

Thanks. I haven't had a chance to try it, but I'll look into that option today. I'm trying to recreate the error as I think it may be related to a script I'm using with the point cloud, but I'm not sure yet and it looks like I have to shut down and restart Max every time I want to test it. More soon.

 

NHAnimator

______________________________________________________________________
Windows 10 Pro, Intel Xeon E5-2630v4, 48GB, NVIDIA Quadro M4000
0 Likes

NHHiker
Advocate
Advocate

@patrick.schock,

 

Okay so I read over what that script does and it's not really going to solve the problem for me. I can get around my problem in a matter of a few seconds or so using my current method. We're not talking about a big time suck here anyway. I thought the problem was related to a very old script I was using which converts a point cloud to a spline. But after quite a bit of testing, I actually found that the problems appears inherent to Max itself.

 

Essentially, if I turn on 3D snapping to Vertex, create a Spline, convert it to an Editable Mesh, then begin creating Faces, the very first face drawn does NOT properly utilize the snapping feature. Every subsequent face DOES. If you watch the attached Screencast, pay attention to the behavior of the cursor's target. During the initial face creation, it displays a grayish + near vertices and will correctly snap if you click. But if you are a little off, it misses the vertex. During any following face creations, it snaps strong and tight with a yellow + sign, making face creation accurate and fast.

 

Further test: If after creating a 'successful' face from the first spline, I create a SECOND spline the same way in the same scene and convert it, when I try to build faces from that spline, the snap behavior fails again with points from that spline. But if I build faces that use a combination of vertices from the first spline and the second, the ones from the first spline are snapped to correctly, while the ones from the second spline are not. So... is it a snapping issue? Or is it an issue with spline creation and the 'current state' of its vertices???

 

I'm probably not doing a great job of describing this, but if you just convert some splines to editable meshes and try to build faces from them, you'll find the snap behavior change between the first face and all subsequent ones.

 

Again, this isn't a huge issue, but there does seem to be something going on.

 

Thanks for your assistance and suggestion,

NHAnimator

 

 

______________________________________________________________________
Windows 10 Pro, Intel Xeon E5-2630v4, 48GB, NVIDIA Quadro M4000
0 Likes

leeminardi
Mentor
Mentor
Accepted solution

The problem may be related to the fact the the line you start with is open and converting it to an editable mesh makes it invisible.  Start with a closed shape made with line and the problem is not there.  The first vertex you click is sensitive to object snap vertex.

 

lee.minardi
0 Likes

patrick.schock
Autodesk Support
Autodesk Support
Accepted solution

Hello @NHHiker and @leeminardi,

 

thanks @leeminardi for posting this workaround. The snapping issue is actually on the list of fixes for further versions, so @NHHiker, does this workaround actually work for you?

 

Looking forward to your reply!

 

Best regards,

Patrick

 

“https://damassets.autodesk.net/content/dam/autodesk/logos/autodesk-logo-primary-rgb-black-small_forum.png”
0 Likes

NHHiker
Advocate
Advocate

@patrick.schock, @leeminardi

 

Thank you for looking into this and your suggested solutions. I will keep the idea of using a closed spline in mind moving forward. In my particular workflow, the idea of closing the spline I am working with takes just as long as the solution I have discovered. Specifically, this is what I do:

 

  • Import a comma-delimited XYZ text file using an old script called Spline Designer Version 0.01 (by Dwayne Ellis and modified by swami on 03.04.00).
  • The imported point cloud consists of usually around 250 points which are brought in as vertices of a single spline.
  • I knock the interpolation steps of that spline down to 0 to remove interpolated points.
  • I then convert it to an Editable Mesh. This leaves me with the "invisible" mesh object.
  • I then begin building faces with the first one being a throwaway.

As all of these steps take me usually less than 30 seconds, taking a few seconds for the last step is not really a big time suck. I could try to close the ends of this spaghetti-like spline before converting it, but I think its really 6 of one thing...

 

Again, thanks much for your assistance,

NHAnimator

 

 

 

 

______________________________________________________________________
Windows 10 Pro, Intel Xeon E5-2630v4, 48GB, NVIDIA Quadro M4000
0 Likes

leeminardi
Mentor
Mentor

I think the following is an easier workaround.  Before converting the lines to an editable mesh check the box Enable In Viewport under Rendering for the object in the Modify panel.  This will make the lines visible after you convert them to an Editable Mesh.  Since they are visible object snap vertex will work the first time you use it! You can select many lines at one time  to Enable their rendering or make it the default when you import the lines.

 

~Lee

lee.minardi
0 Likes

NHHiker
Advocate
Advocate

@leeminardi,

 

Thanks much for this suggestion. Unfortunately, I think my workflow is unique to the point where I continue to fall short in explaining it with enough detail. Indeed, your suggestion works as suggested. But that's actually MORE problematic for me.

 

I have not studied Maxscript and so, therefore, do not understand how this script works, but during the import of my point "cloud", all of the points are connected via a single spline in a somewhat random manner. Therefore, spline segments may connect an edge of pavement (EP) shot to a utility pole shot to a mailbox shot, etc. The spline is almost just a placeholder for the vertices and the spline segments are useless in building faces like I need them built (which consists more of an EP to EP to EP method).

 

So while your method preserves those segments, I need to go and delete all of them right away to start working because their default placement is non-applicable to my work. With my current method, the spline disappears (as does the mesh) until I turn on the Face subobject level and click Create. I am then presented with the cloud of points from which I can build.

 

One thing that MIGHT be helpful is if someone knows of a method by which I can import a text-based, XYZ point file as a single object (mesh) and just start building the faces - thus avoiding having to use an old script. I'm pretty sure that can be done, but I've yet to find a solution that doesn't involve third-party processing.

 

It would be nice if using Max was a full-time job for me. 😞

 

NHAnimator.

______________________________________________________________________
Windows 10 Pro, Intel Xeon E5-2630v4, 48GB, NVIDIA Quadro M4000
0 Likes

Swordslayer
Advisor
Advisor

@NHHiker wrote:

One thing that MIGHT be helpful is if someone knows of a method by which I can import a text-based, XYZ point file as a single object (mesh) and just start building the faces - thus avoiding having to use an old script. I'm pretty sure that can be done, but I've yet to find a solution that doesn't involve third-party processing.


If you can attach the original script (as a zip probably, the forum doesn't like nonstandard extensions), I guess I could edit it to import the points as one mesh directly.

0 Likes

NHHiker
Advocate
Advocate

@Swordslayer

 

Thanks for taking a stab at this. Please don't waste too much of your time. Like I said, there's probably a non-script way to do this. I just don't know of it.

 

I've attached both the script, and a sample data file. When you run the script and select Get File, it defaults to .DAT format. Just change this to .TXT and pull in the dataset. You should see the imported spaghetti spline. From there, I select it, set the Interpolation Steps to 0, then convert it to Editable Mesh. I can then build faces.

 

Thanks,

NHAnimator

______________________________________________________________________
Windows 10 Pro, Intel Xeon E5-2630v4, 48GB, NVIDIA Quadro M4000
0 Likes

Swordslayer
Advisor
Advisor
Accepted solution

Thanks, the dataset to test with is super useful. This should make your life a bit easier:

 

try destroyDialog meshFromTXT catch()
rollout meshFromTXT "Mesh From TXT"
(
	button btnBrowseAndImport "Browse and Import..."
	
	on btnBrowseAndImport pressed do
	(
		local path = getOpenFilename types: "*.txt|*.txt"
		if not isKindOf path String or path.count == 0 do return messageBox "Invalid file"

		local file = openFile path
		local verts = #()

		while not eof file do
			append verts (Point3 (readValue file) (readValue file) (readValue file))

		close file
		Mesh vertices:verts faces:#() isSelected:on vertexTicks:on -- the last argument is setting vertext ticks display, set to off if you don't want that
	)
)
createDialog meshFromTXT
0 Likes

NHHiker
Advocate
Advocate

Well thank you very much for this, @Swordslayer. This does make things flow just a tad easier. I do note that the problem with Max not snapping to vertices during the initial face build still exists. But you did help improve the workflow.

 

Thanks again,

NHAnimator

______________________________________________________________________
Windows 10 Pro, Intel Xeon E5-2630v4, 48GB, NVIDIA Quadro M4000
0 Likes