Cancel
Showing results for 
Search instead for 
Did you mean: 

Thicken Gyroid surface model, offset surface problems, highly complex geometry, convergent modeling

Valued Contributor
Valued Contributor

Hi there,

 

i tried to thicken a gyroid surface which lacks any thickness right now (freshly baked out of matlab imported via STL).

 

Does anyone knows how to thicken a gyroid element or this kind of trippy surfaces?

 

I tried offset surface and thicken already of course.

 

But there are several settings i dont really understand.

 

Furthermore i am thinking of a workaround -> assemble two gyroids next to each other (like 1mm offset) and try to create somthing in the watertightballpark

 

Any clues?

 

Regards

 

 

 

 

10 REPLIES

Re: Thicken Gyroid surface model, offset surface problems, highly complex geometry, convergent model

Valued Contributor
Valued Contributor

I included the STL file in this post.

Re: Thicken Gyroid surface model, offset surface problems, highly complex geometry, convergent model

Phenom
Phenom

I imported your stl as Convergent Body and STL File Units > Meters, then I apply a 5 mm thicken.

 

 

Re: Thicken Gyroid surface model, offset surface problems, highly complex geometry, convergent model

Valued Contributor
Valued Contributor
Hi,

Thank you for your reply.

i assume you scaled it down afterwards?
i try to shape a 100x100x100 mm with thickness between 5-10 mm by this method

i figured you could go 5mm offset one and -5mm offset two but apparently the gyroid was couple meters high Smiley Happy
anyway to change the toleranze for the process?
Is there a way to close one channel of the structure an fill it?

regards


Re: Thicken Gyroid surface model, offset surface problems, highly complex geometry, convergent model

Siemens Legend Siemens Legend
Siemens Legend

Hi Symbolinsight,

 

Quite a tricky little shape you have there. Nevertheless these are my observations and recommendations.

The original import is very small – I assume that you do not want to offset that by 5-10mm as it would be impossible due to minimum radii.

 

For the example presented in the image I have scaled your shape 100 times to have something more workable – however you might not have to do that depending on what size is the correct one here. As the STL imported geometry is not that tidy you need to start by fixing it. Use the “Cleanup Facet Body Option”. For making the sheet body into a solid body by filling the channel you want to close up. Use the “Fill Hole” option – note that there are several options here and you might have to use a combination. For the offset I would recommend to use “Local Offset” and the selection intent “Body Facets”. In my attached image I have filled the holes and made 2 offsets +-30mm.

 

Best Regards

Fred

 

Facet_Operators.png

Re: Thicken Gyroid surface model, offset surface problems, highly complex geometry, convergent model

Valued Contributor
Valued Contributor

It's truly a tricky job

I guess shaping a STL File is somewhat spectacular with CAD Software..

 

A 10mmx10mm one with 0.5mm to 1mm "surface" thickness would be needed

I scaled it to 1.75 times the original size.

It was possible to offset it after the cleanup facet body tool to 0.23mm in both directions

(still using the thicken tool)

 

How excatly did u manage to use the fill hole option?

When i try to apply the tool i get random boxy looking material inserted

Did u use it after the offset or before?

 

Also if you got two offsets ( also doable with the regular offset tool ) do u manage to turn them "solid"

 

The final stage is shown in the attached picture.

I got three convergent bodys (i deleted the initial one in the middle) i would like to make it solid somehow and try another ticken or offset

 

Thank you so far sir!

 

regards

Re: Thicken Gyroid surface model, offset surface problems, highly complex geometry, convergent model

Siemens Legend Siemens Legend
Siemens Legend

Hi Symbolinsight,

 

I think I have a solution for you....getting to that. However just to understand the autiomation a bit better. I this kind of an air filter-ish kind of thing where you want to pattern the 10x10x10 cube?

 

Convergent_Pattern_Lattice.png

 

Best regards

Fred

Re: Thicken Gyroid surface model, offset surface problems, highly complex geometry, convergent model

It is possible to create a second convergent body which is offset from the original convergent body.  My method is to cycle through the facet body of the original convergent body.  for each facet i get the verticies and vertex normal.  Each vertex is offset using its normal vector times the offset distance.  I also determine the facet normal.  This new facet is written out in stl format to a temporary file. For my test case I scaled the gyroid part so that I could avoid using very small numbers format in my new stl file.

 

Here is the image.

Image1.jpg

 

Here is the code.

Option Strict Off
Imports System
Imports System.Math
Imports System.IO
Imports NXOpen
Imports NXOpenUI
Imports NXOpen.UF
Imports NXOpen.Utilities
Imports NXOpen.Facet
Imports NXOpen.Features
Imports MiniSnap

Module EditFacets1
    Dim s As Session = Session.GetSession()
    Dim ui As UI = ui.GetUI()
    Dim ufs As UFSession = UFSession.GetUFSession()
    Dim disppart As Part = s.Parts.Display
    Dim lw As ListingWindow = s.ListingWindow
    Sub Main()
        Dim objtag As Tag = Tag.Null
        Dim type1 As Integer = 139
        Dim count1 As Integer = 0
        Dim level1 As Integer = 0
        Dim facetnumber As Integer = 0
        ufs.Obj.CycleObjsInPart(disppart.Tag, type1, objtag)
        Dim facetobj As FacetedBody = NXObjectManager.Get(objtag)
        facetnumber = facetobj.GetNumberOfFacets(level1)
        Dim novertices As Integer = 3
        Dim cnt1 As Integer = 0
        Dim verticesdbl(2, 2) As Double
        Dim normalsdbl(2, 2) As Double
        Dim path1 As String = "C:\temp\gyroid1.stl" ' change to suit.  stl file is deleted
        Dim sw1 As StreamWriter = File.CreateText(path1)
        Dim startstring As String = "solid STL generated by Frank Swinkels"
        Dim endstring As String = "endsolid vcg"
        sw1.WriteLine(startstring)
        For i As Integer = 0 To facetnumber - 1
            ufs.Facet.AskVerticesOfFacet(facetobj.Tag, i, novertices, verticesdbl)
            ufs.Facet.AskNormalsOfFacet(facetobj.Tag, i, novertices, normalsdbl)
            CreateOffsetSTLFacet(verticesdbl, normalsdbl, sw1)
            cnt1 += 1
        Next
        sw1.WriteLine(endstring)
        sw1.Close()
        ImportSTLFile(path1)
        File.Delete(path1)
        sw1.Close()
    End Sub
    Private Sub CreateOffsetSTLFacet(ByVal vertices(,) As Double, ByVal normals(,) As Double, ByRef sw1 As StreamWriter)
        Dim facetnormalstring As String = "  facet normal "
        Dim outerloopstring As String = "    outer loop"
        Dim vertexstring As String = "      vertex "
        Dim endloopstring As String = "    endloop"
        Dim endfacetstring As String = "  endfacet"
        Dim pos1(2) As Position
        Dim pos2(2) As Position
        Dim pntvec(2) As Vector
        Dim facetnormal As Vector = New Vector
        For i As Integer = 0 To 2
            pos1(i) = New Position(vertices(i, 0), vertices(i, 1), vertices(i, 2))
            pntvec(i) = New Vector(normals(i, 0), normals(i, 1), normals(i, 2))
            pntvec(i) = Vector.Unit(pntvec(i))
        Next
        ' offset the points
        For i As Integer = 0 To 2
            pos2(i) = pos1(i) + 0.2 * pntvec(i)
        Next
        ' get face normal
        facetnormal = Vector.UnitCross(pos2(1) - pos2(0), pos2(2) - pos2(0))
        ' write out facet to stl file
        WriteAFacet(sw1, facetnormal, pos2)
    End Sub
    Private Sub WriteAFacet(ByRef sw1 As StreamWriter, ByVal facetnormal As Vector, ByVal pos1() As Position)
        Dim facetnormalstring As String = "  facet normal "
        Dim outerloopstring As String = "    outer loop"
        Dim vertexstring As String = "      vertex "
        Dim endloopstring As String = "    endloop"
        Dim endfacetstring As String = "  endfacet"
        sw1.WriteLine(facetnormalstring & Round(facetnormal.X, 4).ToString & " " & Round(facetnormal.Y, 4).ToString & " " & Round(facetnormal.Z, 4).ToString)
        sw1.WriteLine(outerloopstring)
        sw1.WriteLine(vertexstring & Round(pos1(0).X, 4).ToString & " " & Round(pos1(0).Y, 4).ToString & " " & Round(pos1(0).Z, 4).ToString)
        sw1.WriteLine(vertexstring & Round(pos1(1).X, 4).ToString & " " & Round(pos1(1).Y, 4).ToString & " " & Round(pos1(1).Z, 4).ToString)
        sw1.WriteLine(vertexstring & Round(pos1(2).X, 4).ToString & " " & Round(pos1(2).Y, 4).ToString & " " & Round(pos1(2).Z, 4).ToString)
        sw1.WriteLine(endloopstring)
        sw1.WriteLine(endfacetstring)
    End Sub

    Public Sub ImportSTLFile(ByVal path1 As String)
        Dim sTLImportBuilder1 As NXOpen.Facet.STLImportBuilder = Nothing
        sTLImportBuilder1 = disppart.FacetedBodies.CreateSTLImportBuilder()
        sTLImportBuilder1.File = path1
        sTLImportBuilder1.AngularTolerance = NXOpen.Facet.STLImportBuilder.AngularToleranceTypes.Medium
        If disppart.PartUnits = BasePart.Units.Millimeters Then
            sTLImportBuilder1.STLFileUnits = NXOpen.Facet.STLImportBuilder.STLFileUnitsTypes.Millimeters
        Else
            sTLImportBuilder1.STLFileUnits = NXOpen.Facet.STLImportBuilder.STLFileUnitsTypes.Inches
        End If
        Dim nXObject1 As NXOpen.NXObject = Nothing
        nXObject1 = sTLImportBuilder1.Commit()
        sTLImportBuilder1.Destroy()
    End Sub

    Public Function GetUnloadOption(ByVal dummy As String) As Integer
        GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately
    End Function

End Module

I have attached the part file that worked.  A word of warning.  If you scale the the convergent body you need to make certain that the facet body is also scaled because the code works on the facet body.

 

 

Frank Swinkels

Re: Thicken Gyroid surface model, offset surface problems, highly complex geometry, convergent model

Valued Contributor
Valued Contributor

@Sandmani want to implement those sctuctures as support lattice. This is my favourite side project atm Smiley Happy

 

If i manage to create those cells with variable sizes and thickness i could manage to pattern it big as you did in the picture.

I would go ahead and place this structure in the zone which desires some support structure and unite it (like the "new" lattice tool but with gyroids)

Maybe apply couple of radii at the intersections.

 

Also it can be used for some cooling channels i want to simulate.

The structure supports and acts as heat sink at once.

 

Would be interesting to simulate the benefits of those gyroid structures vs. regular lattice types or honeycombs

 

I would need a minimum about 0.4 mm wall thickness in 10mmx10mmx10mm cell.

If this is not possible i will reduce the cell count and try again.

 

Can u explain how u used the "fill hole" tool.

 

Closing one half of the structure would be of great benefit for me as one could keep the "large tube"

 

Also the offset Implementation is really awesome!

This extends my relativly fresh knowledge of NX right now but i ll definetely look into it, now that you actually provided code.

 

Thank you so far guys.

 

Regards

Re: Thicken Gyroid surface model, offset surface problems, highly complex geometry, convergent model

Siemens Legend Siemens Legend
Siemens Legend

Hi Symbolinsight,

 

The attached movie below are based on your requirements:

 

  • Size 10x10x10mm
  • Input to Lattice
  • Thickness (+-0.5mm)
  • Ability to close either channel off

It is showing a quick way of turning your STL mesh into a solid by using the powerful hybrid modeling capabilities including the use Facet Geometry of in NX. The movie will take you all the way from Import to Patterned solid geometry with t=1.

 

There are several ways of going about this but with the associativity requirement the powerful hybrid modeling I believe this is what you want.

 

(view in My Videos)

 

I hope this helps you.

 

Best Regards

Fred