Sdk basic modifier


#21

Got it to work!!! finally :slight_smile:

All I need now is to make the offset of the slice correspond to the actual scene units, but great, so pleased.

Thanks for all the help guys! couldn’t have figured it out without the help!!


#22

Trying to get the offset of mnmesh::Slice to correspond to the units system, ie slice every 10mm. Unsure how to do this, this is the description on the function for offset param.

The offset of the slice plane. For any point X in the plane, DotProd(N,X) =
off.\n\n

#23

it’s the standard plane equation, so the plane is defined by a direction normal and the dot of the normal and any point on that plane.
so the offset in your case would be

offset = DotProd(normal, Point3(0.0f,0.0f,zoffset));


#24

thanks Klvnk, fixed! Im trying to figure out how to delete selected edges now :slight_smile:


#25

I’ve got the edges selected but how the hell do I remove them with their verts & face. It’s hard to find what your looking for in the samples :confused:


#26

collect your edges
tag all the faces using the edges(MNEdge::f1 & MNEdge::f2)
with MNFace::SetFlag(flag_to_tag);

delete faces with

MNMesh::DeleteFlaggedFaces(flag_to_tag); 
MNMesh::CollapseDeadStructs();

#27

Thanks Klvnk, I’m such a newb Im still stuck.

I know that I have the extruded edges selected

pmesh.ExtrudeEdges(MN_SEL, &chamData, tUpDir);

then this moves them.

Tab < Point3 > tUpDir;
tUpDir.SetCount(pmesh.numv);

for (i = 0; i < tUpDir.Count(); i++) pmesh.v[i].p += tUpDir[i] * 10;

now how do I use the above to set a flag (MN_USER) to the selected edges?

sorry for all silly questions :slight_smile: