Keep crashing when trying to use the Surface Tessellation api in protoolkit
I'm trying to use the Surface Tessellation api's.
Surface Tessellation has the following functions
- ProSurfaceTessellationGet()
- ProTessellationFree()
- ProTessellationVerticesGet()
- ProTessellationNormalsGet()
- ProTessellationParamsGet()
- ProSurfacetessellationinputFree()
- ProSurfacetessellationinputChordheightSet()
- ProSurfacetessellationinputAnglecontrolSet()
- ProSurfacetessellationinputStepsizeSet()
- ProSurfacetessellationinputUvprojectionSet()
What I want to do is for a given surface, tesselate it with defined quality metrices, and then find information about the facets and vertices.
I would expect that I can write code that looks like this.
ProError err1 = ProSurfaceInit(m_pro_mdl, (int) SourceSequence, &pro_surface);
if(err1 == PRO_TK_NO_ERROR)
{
ProSurfaceTessellationInput *tessellationInput = new ProSurfaceTessellationInput();
err1 = ProSurfacetessellationinputAlloc(tessellationInput);
if (err1 != PRO_TK_NO_ERROR) return;
err1 = ProSurfacetessellationinputStepsizeSet(*tessellationInput, 1000);
if (err1 != PRO_TK_NO_ERROR) return;
err1 = ProSurfacetessellationinputChordheightSet(*tessellationInput, 0.0);
if (err1 != PRO_TK_NO_ERROR) return;
err1 = ProSurfacetessellationinputAnglecontrolSet(*tessellationInput, 0.0);
ProTessellation* tessellation = new ProTessellation();
err1 = ProSurfaceTessellationGet(pro_surface, *tessellationInput, tessellation);
}
I should then be able to use the ProTessellationFacetsGet and ProTessellationVerticesGet methods with the tessellation variable to get information about the tessellated facets and vertices. Like the following.
Pro3dPnt **vertices = NULL;
err1 = ProTessellationVerticesGet(*tessellation, vertices);
The problem I am having is that I get crashes about non existant memory problems whenever I try to call the any of the these functions
ProSurfacetessellationinputStepsizeSet
ProSurfacetessellationChordheightSet
ProSurfacetessellationinputAnglecontrolSet.
I can't figure out how to use this section of the API.
Wendell Duncan
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.

