SUFaceCreateSimple failed with SU_ERROR_GENERIC (6)


#1

Hi Experts,
I met face create failed with following data when using SUFaceCreateSimple:

{x=-0.15751288694035770 y=0.30000000000000049 z=0.0044427990697236000 }
{x=-0.16751288694035774 y=0.29732050807568927 z=0.0044427990697234005 }
{x=-0.16268926784240811 y=0.29931851652578190 z=0.0044427990697234005 }

res = SUFaceCreateSimple(&face, &vertices[0], vertices.size());

And I checked the description it tell that SU_ERROR_GENERIC means the vertices didn’t within the face’s tolerance 1.0e-3, while I am using only three points to create a triangle face and suppose every vertex should be on the face,
can you help take a check?

Danny


#2

That’s not the only source. The error says “generic” for a reason. It also return that error if the area of the face is not valid (too small).

Do you have a small standalone snippet that include how you create the vertices and face ref?


#3

I have created a small app using my data.
Basing on my observation the data used for face creating when assert happen can create face successfully when only create the only face. while if given the whole dataset this specific data will fail.

FaceCreation.zip (1.9 MB)

Exported sketchup file, some faces are missing due to the creation failure:

Original model:


#4

So the function fails when computing least square fit for the vertices. Looking at the data for the face that fails it appear some very small faces, the faces are nearly on top of each other. So it looks like the face is too small for the tolerance of SketchUp.

At least I think that’s why it’s failing.

If you scale up the data, does it work then?


#5

scale up the data works. so I will leave this issue as it is.

Thank you,
Danny


#6

If the face missing is caused by the tolerance of SketchUp, Can I know how much is the tolerance of the SketchUp?


#7

Points closer than 1/1000th of an inch is considered to have equal position.


#8

Thank you. We will try to set the proper tolerance when write data into the SketchUp.


#9

Hi tt_su, I want to know whether there is any C API to set the SketchUp model tolerance. It is better if there is such API.


#10

I assume that 1/1000th of an inch is absolute tolerance in SketchUp, am I right?


#11

Currently that is an absolute tolerance - SketchUp doesn’t have facilities to adjust the tolerances in models. (Which is a big issue for us as it makes it difficult to make small models with small details - as is often the case in 3d printing.)

There is no guaranty that this will stay like this forever though.


#12

Hi tt_su, I run into the same problem of small faces lost in SketchUp. According to your explanation,

  1. SketchUp uses Inch as the modeling unit which is unchangeable.
  2. SketchUp uses 0.001 Inch as modeling tolerance which is unchangeable.
    The mesh data I have may contain small faces which edges are shorter than 0.001 inch, so when we create the SketchUp model based on the mesh data, the small faces will be lost when opening in SketchUp.
    But I am confused by the “fix” dialog popped up, the model seems worse with more faces lost when I click “fix” than “fix later”.

    So I have below questions:
  3. I wonder how SketchUp “fix” the model and why the “fix” introduce more holes?
  4. Do you have any suggestions on how to deal with the “small face” issue besides scale the mesh data?
  5. Is there a schedule for SketchUp to support the tighter tolerance e.g. 1e-6 inch for handling the design data for 3D Printing?

Thanks.


#13

@syfmore - I take it you are using SUFaceCreateSimple? Recently we discovered that this function and SUFaceCreate doesn’t merge the face with the entities already in the model. This result in models where you have duplicate vertices and edges. Until we can address this I’d strongly urge you to use SUGeometryInput.

As for the faces being lost - if you managed to create small faces with the API and the Fix Model is run it might consider some of your faces to be degenerate (zero area for instance) and therefore remove it.

I’m afraid not.

I cannot provide a timeline for this. All I can say it’s that it’s a well known limitation that frustrates us as well.