Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:

  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Converting STL files into a Model format that can be used in a sketch

ian_maleyian_maley Member Posts: 6 PRO
Hi
Does anyone have any suggestions on this one? having googled the question, seems like it can be done on importing on Solid Works but doesn't seem to have the same facility in Onshape, the best I have so far is to export as an IGES file so that a sketch can be created around the part, but it still has no direct intersect with it so is pretty useless - open to ideas?
thanks as always

Ian.
Tagged:

Best Answers

Answers

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 2,518
    Not sure what you are trying to do? You can import STL files but not sure what you mean by intersect? STL files are for reference only. 
    Neil Cooke, Director of Technical Marketing, Onshape Inc.
  • ian_maleyian_maley Member Posts: 6 PRO
    NeilCooke said:
    Not sure what you are trying to do? You can import STL files but not sure what you mean by intersect? STL files are for reference only. 
    Hi Neil, I want to be able to use imported STL as a functional part and to be able sketch other parts around it

  • owen_sparksowen_sparks Member, Developers Posts: 2,435 PRO
    ian_maley said:
    NeilCooke said:
    Not sure what you are trying to do? You can import STL files but not sure what you mean by intersect? STL files are for reference only. 
    Hi Neil, I want to be able to use imported STL as a functional part and to be able sketch other parts around it

    You can, ish.

    Every vertex in the stl can be "used/projected onto a sketch" so depending on the complexity of what you want all may be good.  What you can't do today is Boolean like operations between your part and the stl.

    I've used this method a couple of times and had positive results, but it's certainly easier if you can find the model you wish to import in say a step or parasolid file. :)

    Owen S.
    Production Engineer
    HWM-Water Ltd
  • Object_MageObject_Mage Member Posts: 13 EDU
    When will Onshape be able to import stl file type? that is ridiculous 
  • owen_sparksowen_sparks Member, Developers Posts: 2,435 PRO
    kai_gull said:
    When will Onshape be able to import stl file type? that is ridiculous 
    Sorry I'm not sure I understand your question; we've been able to import stl files for about a year now.

    Are you talking about converting the file to a solid, or building around it?

    Owen S.
    Production Engineer
    HWM-Water Ltd
  • larry_haweslarry_hawes Member Posts: 427 PRO
    edited March 2018
    Just discovered this thread and was curious about importing STL files and building around them, specifically I have a surfboard fin program that will export STL's of the fin shapes but I need a way to attach a base to the STL and 3D print the resulting combined STL on a 3D printer. Any suggestions?

    edit: I can import the STL in to OnShape and I can sketch a base but cannot get both the STL and the base to export to STL for my 3D printer. When I export all I get is the base sketch.

    Here's a link to the part 

    https://cad.onshape.com/documents/129e3469b17c2a539db4cda9/w/a93e0ef521d8bc5fa8342388/e/98d592b54e945c6fcd39db9b
  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,406
    @larry_hawes

    I tried this out and it does seem like what you're trying is not possible.  Please contact support about this use case by pressing "Feedback" under the "?" menu in your part studio.
    Jake Rosenfeld - Modeling Team
  • larry_haweslarry_hawes Member Posts: 427 PRO
    edited March 2018
    Thanks Jake,

    I've researched this a bit and few apps are supposed to be able to accomplish this but they have all failed me in some way. Would love to have this feature in OnShape as 3D printing is the future and STL mesh format is the default 3D print file.

    Thanks
  • claude_reynald_lecorpsclaude_reynald_lecorps Member Posts: 1
    edited March 2018
    If you can convert an STL to an SLDPRT file, it imports as a part instead of a mesh. Can't be used as a sketch I don't think but you can add features to it to reshape the part
  • larry_haweslarry_hawes Member Posts: 427 PRO
    If you can convert an STL to an SLDPRT file, it imports as a part instead of a mesh. Can't be used as a sketch I don't think but you can add features to it to reshape the part

    Seems like a person might need Solid Works to accomplish the suggestion? If so, seems like quite an investment to get the desired functionality.

  • tiberio_ferreiratiberio_ferreira Member Posts: 1 EDU
    Hello, just wanting to reiterate how important this feature is.
  • StephenGStephenG Member Posts: 256 ✭✭✭
    Calling all FeatureScript Wizards....

    Would someone please write a feature script that converts a manifold Mesh (imported STL file) into a OS part.

    Currently, only the vertices of the mesh are selectable for measurement, Use'ing and functions that accept points. If the mesh (faceted B-rep) was a "real" OS part then facets could be leveraged for operations requiring a plane and the facet edges could also be leveraged for operations that utilize a line/vector. 

    (I know it is possible to create a plane coincident with a mesh facet using the 3-point method, but it is rather tedious.)

    The only issue I see is that an OS point is not just a simple XYZ coordinate, but has a planar quality (associated sketch plane) where there is some notion of an up/down direction. 

  • MBartlett21MBartlett21 Member Posts: 1,658 EDU
    StephenG said:
    Currently, only the vertices of the mesh are selectable for measurement, Useing and functions that accept points.
    @StephenG
    Not quite correct

    Meshes can be used for boolean operations, and the end result is a mesh
    See forum post here and my Boolean FeatureScript here.
    MB - I make FeatureScripts:View FeatureScripts
  • owen_sparksowen_sparks Member, Developers Posts: 2,435 PRO
    Also worth noting that the convert to solid isn't much use on it's own.  If there is anything curved on the model these will result in facets.  Potentially 10s of thousands or more.  These will be transformed to the solid, making an ugly part with horrendous overheads and performance.

    Part 2 of this dilemma would need some inbuilt feature intelligence to convert that mess into something with actual geometry, and that's a whole new level of complexity.  For once I have some sympathy for software engineers as normally I'm against the "CTRL-C, CTRL-V Monkeys" just on principle...  The convert STL problem is much bigger than a "can you just" request!

    Cheers, Owen S.

    Production Engineer
    HWM-Water Ltd
  • GWS50GWS50 Member Posts: 131 PRO
    This is the method I use to get an STL into a PART in OnShape.

    Open the STL in Meshlab and decimated down to 4950 faces or less. (If you convert it to quad- dominant it can be 9950 faces)
    Export the STL
    Open STL in Vectorworks
    Convert to a Generic Solid; Modify>Convert>Convert to Generic Solid
    Export the Generic Solid as Parasolid
    Import into Onshape

    This works most of the time except when the decimation causes faults. If faults occur I use Meshmixer to run a repair and then repeat the process.
    Meshlab and Meshmixer are free but I'm afraid Vectorworks is not. I'm still trying to find a better method.
    It took a long time to figure this out and I'm not sure why the face count needs to be below 5000 and 10000 (Tri or Quad)

    Here is mouse that I able to cut about and hollow out

    Hope this helps


  • owen_sparksowen_sparks Member, Developers Posts: 2,435 PRO
    Nice job :+1:
    Owen S.
    Production Engineer
    HWM-Water Ltd
  • StephenGStephenG Member Posts: 256 ✭✭✭
    @MBartlett21
    I believe the statement: "Currently, only the vertices of the mesh are selectable for measurement, Useing and functions that accept points" is still an accurate assessment of the current state of OS.

    I read the referenced forum post (BOOLEAN INTERSECT WITH MESH) and looked at your custom FeatureScript Boolean Plus (2.4.8). The post states the functionality to boolean meshes has existed since 1.87 (Released 2018-10-20). In reality boolean of meshes is not currently supported via the standard OS Boolean feature; it is only available using your FeatureScript.

    Impressive piece of scripting work, but as you point out the resultant is still a mesh and therefore has all the inherent limitations of mesh data in OS that exist today. 

    @owen_sparks 
    A faceted B-Rep that is recognized as a valid OS part has tremendous value in the design process where the only representation of an imported part is from an STL file. (Being able to instance a mesh into an assembly would be very beneficial.)  

    I believe you read too much into my plea for a FeatureScript wizard to create something that would make the STL facet data more usable in OS. My plea was more of an intellectual challenge directed towards FeatureScript experts out there. I was not asking for a conversion of the faceted representation into an equivalent part model of trimmed surfaces. However, it would be much appreciated if coplanar adjacent triangular STL facets are merged into N-sided facets to simplify (reduce) visual clutter and improve rendering/interaction performance. 

    @GWS50
    Your persistence is impressive. I will check out the Meshlab and Vectorworks product. I have limited experience using Meshmixer. Not a real fan of "organic" mesh creation/manipulation tools. 

  • MBartlett21MBartlett21 Member Posts: 1,658 EDU
    StephenG said:
    Impressive piece of scripting work, but as you point out the resultant is still a mesh and therefore has all the inherent limitations of mesh data in OS that exist today. 

    I agree that it cannot turn meshes into parasolid data, but this can be useful for editing meshes and exporting them again.
    MB - I make FeatureScripts:View FeatureScripts
  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,406
    @StephenG Unfortunately we do not expose mesh points to FeatureScript because we do not consider them to be stable references, and they could affect the regeneration of the model in a way that we do not desire.  So, for now, FeatureScript is probably not a good path to go down for interacting with meshes.

    We exposed the ability to Boolean a solid with a mesh to FeatureScript as an initial exploration into having more built-in functionality around mesh manipulation.  We understand this is a useful workflow and have more plans to explore these workflows in the future.
    Jake Rosenfeld - Modeling Team
Sign In or Register to comment.