STL shows unwanted co-planar faces in SketchUp and DesignSpark

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

STL shows unwanted co-planar faces in SketchUp and DesignSpark

psehorne
When I import the STL file exported from OpenSCAD from the code below into either SketchUp or DesignSpark all faces of the model have two  co-planar sections.
OpenSCAD stl imported into SketchUp 
What's going on?

pitch = 1.25;  //8mm coarse thread
height = pitch * cos(30); //based on 60 degree profile
major_diameter = 7.78; //M8 = 7.78-8.00
minor_diameter = major_diameter - 2*(height*5/8);
echo ("major_diameter = ", major_diameter);
echo ("minor_diameter = ", minor_diameter);
echo ("pitch = ", pitch);
echo ("height = ", height);

//external thread for a bolt
square_size = pitch/8+.2;

linear_extrude(height = .01)
difference()
{
    polygon(points = [ [0, 0], [0, pitch],[height,pitch/2], ], convexity = 2);
    #translate([height*7/8+square_size/2,pitch/2,0])
    square(square_size,center=true);
}
Reply | Threaded
Open this post in threaded view
|

Re: STL shows unwanted co-planar faces in SketchUp and DesignSpark

nophead
STL files only store triangles so each face is broken into triangular facets.

On 15 February 2016 at 19:04, psehorne <[hidden email]> wrote:
When I import the STL file exported from OpenSCAD from the code below into
either SketchUp or DesignSpark all faces of the model have two  co-planar
sections.
<http://forum.openscad.org/file/n16152/OpenSCAD.png>
What's going on?

pitch = 1.25;  //8mm coarse thread
height = pitch * cos(30); //based on 60 degree profile
major_diameter = 7.78; //M8 = 7.78-8.00
minor_diameter = major_diameter - 2*(height*5/8);
echo ("major_diameter = ", major_diameter);
echo ("minor_diameter = ", minor_diameter);
echo ("pitch = ", pitch);
echo ("height = ", height);

//external thread for a bolt
square_size = pitch/8+.2;

linear_extrude(height = .01)
difference()
{
    polygon(points = [ [0, 0], [0, pitch],[height,pitch/2], ], convexity =
2);
    #translate([height*7/8+square_size/2,pitch/2,0])
    square(square_size,center=true);
}



--
View this message in context: http://forum.openscad.org/STL-shows-unwanted-co-planar-faces-in-SketchUp-and-DesignSpark-tp16152.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: STL shows unwanted co-planar faces in SketchUp and DesignSpark

psehorne
Darn!  but THANKS, nophead.  I'll have to work around that behavior.
Reply | Threaded
Open this post in threaded view
|

Re: STL shows unwanted co-planar faces in SketchUp and DesignSpark

kintel
Administrator
> On Feb 15, 2016, at 14:23 PM, psehorne <[hidden email]> wrote:
>
> Darn!  but THANKS, nophead.  I'll have to work around that behavior.
>
What formats do DesignSpark and SketchUp import which would be able to provide the wanted results?

Merging planar triangles into larger faces is something that can be done on import. Such functionality would typically be part of said CAD packages. I would recommend contacting customer support there and inquire about this.

 -Marius


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: STL shows unwanted co-planar faces in SketchUp and DesignSpark

fred_dot_u
Meshmixer is a free program that has an "inspector" feature. I've not intentionally created co-planar triangles, so I can't say that it would correct it, but the price is right.


On Wednesday, February 17, 2016 4:52 PM, Marius Kintel <[hidden email]> wrote:


> On Feb 15, 2016, at 14:23 PM, psehorne <[hidden email]> wrote:
>
> Darn!  but THANKS, nophead.  I'll have to work around that behavior.
>
What formats do DesignSpark and SketchUp import which would be able to provide the wanted results?

Merging planar triangles into larger faces is something that can be done on import. Such functionality would typically be part of said CAD packages. I would recommend contacting customer support there and inquire about this.

-Marius



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: STL shows unwanted co-planar faces in SketchUp and DesignSpark

Kenneth Sloan
In reply to this post by kintel
Can someone point me to an authoritative STANDARD for .stl files that says that all facets must consist of a single outerloop and that loop must contain exactly 3 vertices?

This is, of course, for ASCII .stl files.

--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.




> On Feb 17, 2016, at 15:51 , Marius Kintel <[hidden email]> wrote:
>
>> On Feb 15, 2016, at 14:23 PM, psehorne <[hidden email]> wrote:
>>
>> Darn!  but THANKS, nophead.  I'll have to work around that behavior.
>>
> What formats do DesignSpark and SketchUp import which would be able to provide the wanted results?
>
> Merging planar triangles into larger faces is something that can be done on import. Such functionality would typically be part of said CAD packages. I would recommend contacting customer support there and inquire about this.
>
> -Marius
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: STL shows unwanted co-planar faces in SketchUp and DesignSpark

kintel
Administrator
> On Feb 17, 2016, at 18:46 PM, Kenneth Sloan <[hidden email]> wrote:
>
> Can someone point me to an authoritative STANDARD for .stl files that says that all facets must consist of a single outerloop and that loop must contain exactly 3 vertices?
>
AFAIK, there is no authorative STL standard.
Technically, you could store any size polygon in STL files, but the convention is that it’s only used for triangles.
As binary STL doesn’t even have an option for storing other than triangles, that should be a good guideline for what to put in ASCII STL files, to allow bi-directional compatibility.

 -Marius


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: STL shows unwanted co-planar faces in SketchUp and DesignSpark

nophead
In reply to this post by Kenneth Sloan
It says an STL file consists of lists of triangular facets.



On 17 February 2016 at 23:46, Kenneth Sloan <[hidden email]> wrote:
Can someone point me to an authoritative STANDARD for .stl files that says that all facets must consist of a single outerloop and that loop must contain exactly 3 vertices?

This is, of course, for ASCII .stl files.

--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.




> On Feb 17, 2016, at 15:51 , Marius Kintel <[hidden email]> wrote:
>
>> On Feb 15, 2016, at 14:23 PM, psehorne <[hidden email]> wrote:
>>
>> Darn!  but THANKS, nophead.  I'll have to work around that behavior.
>>
> What formats do DesignSpark and SketchUp import which would be able to provide the wanted results?
>
> Merging planar triangles into larger faces is something that can be done on import. Such functionality would typically be part of said CAD packages. I would recommend contacting customer support there and inquire about this.
>
> -Marius
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: STL shows unwanted co-planar faces in SketchUp and DesignSpark

ednisley
In reply to this post by Kenneth Sloan
> an authoritative STANDARD for .stl files

Wikipedia probably isn't authoritative:

> The STL file format appears capable of defining a polyhedron
 > with any polygonal facet, but in practice it is only ever used
 > for triangles, which means that much of the syntax of the
 > ASCII protocol is superfluous.

So, yeah, you /could/ put more than three vertexes in each entry, but
/everything/ else would immediately break.

They reference a "Standard Data Format for Fabbers" document dating back
to 1989 that everybody probably used as The Definitive Document:

http://www.fabbers.com/tech/STL_Format

It starts off by saying that it's triangles all the way down...


--
Ed
softsolder.com

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
 --
Ed
softsolder.com
Reply | Threaded
Open this post in threaded view
|

Re: STL shows unwanted co-planar faces in SketchUp and DesignSpark

doug.moen
In reply to this post by Kenneth Sloan
This is a historical reconstruction of the original 1989 STL specification.

On Wednesday, 17 February 2016, Kenneth Sloan <[hidden email]> wrote:
Can someone point me to an authoritative STANDARD for .stl files that says that all facets must consist of a single outerloop and that loop must contain exactly 3 vertices?

This is, of course, for ASCII .stl files.

--
Kenneth Sloan
<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;KennethRSloan@gmail.com&#39;)">KennethRSloan@...
Vision is the art of seeing what is invisible to others.




> On Feb 17, 2016, at 15:51 , Marius Kintel <<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;marius@kintel.net&#39;)">marius@...> wrote:
>
>> On Feb 15, 2016, at 14:23 PM, psehorne <[hidden email]> wrote:
>>
>> Darn!  but THANKS, nophead.  I'll have to work around that behavior.
>>
> What formats do DesignSpark and SketchUp import which would be able to provide the wanted results?
>
> Merging planar triangles into larger faces is something that can be done on import. Such functionality would typically be part of said CAD packages. I would recommend contacting customer support there and inquire about this.
>
> -Marius
>
>
> _______________________________________________
> OpenSCAD mailing list
> <a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;Discuss@lists.openscad.org&#39;)">Discuss@...
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;Discuss@lists.openscad.org&#39;)">Discuss@...
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: STL shows unwanted co-planar faces in SketchUp and DesignSpark

psehorne
In reply to this post by psehorne
I have found in DesignSpark that I can right-click on an object in the 
Structure view and select 'Convert to solid' -> 'Merge faces' and undo the 
unsavory behavior of OpenSCAD
--
Paul

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: STL shows unwanted co-planar faces in SketchUp and DesignSpark

Ronaldo
Paul
What you call "unsavory" behaviour of OpenSCAD is a standard procedure most software do when exporting stl. If you want to discard the disposable edges of the stl in Sketchup use the plugin Cleanup by Thomthom (http://sketchucation.com/pluginstore?pagecount=1&author=1149&listtype=1&currentpage=1&actualpage=Next+%3E).

What I call unsavoury behaviour is the ability Sketchup has to destroy the topology when importing a healthy stl with a dense set of vertices. To confirm this just import any gear you find in Thingverse. To solve this you will need another plugin by Thomthom: Solid Inspector and a lot of manual work.

Ronaldo

2016-02-18 2:54 GMT-02:00 Paul F. Sehorne <[hidden email]>:
I have found in DesignSpark that I can right-click on an object in the 
Structure view and select 'Convert to solid' -> 'Merge faces' and undo the 
unsavory behavior of OpenSCAD
--
Paul

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: STL shows unwanted co-planar faces in SketchUp and DesignSpark

jon_bondy
Paul, Ronaldo:

The best way to import STLs into SketchUp is to first use an external utility (NetFabb Basic is fine) to make them 10 or 100 times larger than the original.  Then SketchUp does not bother to "fix" the fine/detailed aspects of the model, and you do not have to use Cleanup or Solid Inspector.  I then re-scale them back down when I'm done, sometimes in SketchUp, but sometimes using NetFabb Basic again.

Jon

On 2/18/2016 12:32 AM, Ronaldo Persiano wrote:
Paul
What you call "unsavory" behaviour of OpenSCAD is a standard procedure most software do when exporting stl. If you want to discard the disposable edges of the stl in Sketchup use the plugin Cleanup by Thomthom (http://sketchucation.com/pluginstore?pagecount=1&author=1149&listtype=1&currentpage=1&actualpage=Next+%3E).

What I call unsavoury behaviour is the ability Sketchup has to destroy the topology when importing a healthy stl with a dense set of vertices. To confirm this just import any gear you find in Thingverse. To solve this you will need another plugin by Thomthom: Solid Inspector and a lot of manual work.

Ronaldo

2016-02-18 2:54 GMT-02:00 Paul F. Sehorne <[hidden email]>:
I have found in DesignSpark that I can right-click on an object in the 
Structure view and select 'Convert to solid' -> 'Merge faces' and undo the 
unsavory behavior of OpenSCAD
--
Paul



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: STL shows unwanted co-planar faces in SketchUp and DesignSpark

psehorne
In reply to this post by Ronaldo
I tried Cleanup2 in Sketchup.  Although it improved the model, it still left two co-planar facets on each face which DesignSpark treated, of course, as separate items.  I still had to use DesignSpark's 'merge faces' capability.

On 2/17/2016 11:32 PM, Ronaldo Persiano wrote:
Paul
What you call "unsavory" behaviour of OpenSCAD is a standard procedure most software do when exporting stl. If you want to discard the disposable edges of the stl in Sketchup use the plugin Cleanup by Thomthom (http://sketchucation.com/pluginstore?pagecount=1&author=1149&listtype=1&currentpage=1&actualpage=Next+%3E).

What I call unsavoury behaviour is the ability Sketchup has to destroy the topology when importing a healthy stl with a dense set of vertices. To confirm this just import any gear you find in Thingverse. To solve this you will need another plugin by Thomthom: Solid Inspector and a lot of manual work.

Ronaldo

2016-02-18 2:54 GMT-02:00 Paul F. Sehorne <[hidden email]>:
I have found in DesignSpark that I can right-click on an object in the 
Structure view and select 'Convert to solid' -> 'Merge faces' and undo the 
unsavory behavior of OpenSCAD
--
Paul

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org




_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


--
Paul

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: STL shows unwanted co-planar faces in SketchUp and DesignSpark

psehorne
In reply to this post by jon_bondy
Thanks for the info

On 2/18/2016 1:34 AM, jon_bondy [via OpenSCAD] wrote:
Paul, Ronaldo:

The best way to import STLs into SketchUp is to first use an external utility (NetFabb Basic is fine) to make them 10 or 100 times larger than the original.  Then SketchUp does not bother to "fix" the fine/detailed aspects of the model, and you do not have to use Cleanup or Solid Inspector.  I then re-scale them back down when I'm done, sometimes in SketchUp, but sometimes using NetFabb Basic again.

Jon

On 2/18/2016 12:32 AM, Ronaldo Persiano wrote:
Paul
What you call "unsavory" behaviour of OpenSCAD is a standard procedure most software do when exporting stl. If you want to discard the disposable edges of the stl in Sketchup use the plugin Cleanup by Thomthom (http://sketchucation.com/pluginstore?pagecount=1&author=1149&listtype=1&currentpage=1&actualpage=Next+%3E).

What I call unsavoury behaviour is the ability Sketchup has to destroy the topology when importing a healthy stl with a dense set of vertices. To confirm this just import any gear you find in Thingverse. To solve this you will need another plugin by Thomthom: Solid Inspector and a lot of manual work.

Ronaldo

2016-02-18 2:54 GMT-02:00 Paul F. Sehorne <[hidden email]>:
I have found in DesignSpark that I can right-click on an object in the 
Structure view and select 'Convert to solid' -> 'Merge faces' and undo the 
unsavory behavior of OpenSCAD
--
Paul



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



If you reply to this email, your message will be added to the discussion below:
http://forum.openscad.org/STL-shows-unwanted-co-planar-faces-in-SketchUp-and-DesignSpark-tp16152p16172.html
To unsubscribe from STL shows unwanted co-planar faces in SketchUp and DesignSpark, click here.
NAML

--
Paul