# How to remove border on creating (rectangle) custom mesh/

**URL:** <https://forum.techsoft3d.com/t/how-to-remove-border-on-creating-rectangle-custom-mesh/4008>\
**Category:** HOOPS Visualize Web\
**Tags:** code\
**Created:** [September 2, 2024, 8:44am UTC](https://forum.techsoft3d.com/t/how-to-remove-border-on-creating-rectangle-custom-mesh/4008 "2024-09-02T08:44:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![raja.r](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@raja.r](https://forum.techsoft3d.com/u/raja.r)\
**Post date:** [September 2, 2024, 8:44am UTC](https://forum.techsoft3d.com/t/how-to-remove-border-on-creating-rectangle-custom-mesh/4008/1 "2024-09-02T08:44:35Z")

</div>

(imageWidth/

 ![Screenshot 2024-09-02 at 2.13.12 PM](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/2X/9/962aa1930478b035df866ab2496a20c5eedc325c.png)

```auto

        const width = scalingFactor * 
1000)
        const height = scalingFactor * (imageHeight/1000)

        // Setup the box mesh info
        // prettier-ignore
        const boxVertices = [ 0, 0, 0, width , 0, 0, 0, -height, 0,
                              width, 0, 0, width, -height, 0, 0, -height, 0 ];

        const boxUvs = [ 0, 1, 1, 1, 0, 0, // Bottom-left
                         1, 1, 1, 0, 0, 0 ];
        
        let boxCreationFlags =
            Communicator.MeshInstanceCreationFlags.Invisible |
            Communicator.MeshInstanceCreationFlags.DoNotLight |
            Communicator.MeshInstanceCreationFlags.ExcludeBounding

        const scaleMatrix = new Communicator.Matrix()
        const textWorldHeight = await this._calculateTextBoxHeight()
        scaleMatrix.setScaleComponent(textWorldHeight, textWorldHeight, 1.0)
        
        // Let the system continually rotate the text for us
        boxCreationFlags |= Communicator.MeshInstanceCreationFlags.ScreenOriented
        boxMatrix = scaleMatrix
      

        // Setup the mesh instance data now. No color required since we're going to
        // place a texture over the entire face
        const boxMeshData = new Communicator.MeshData()
        boxMeshData.setFaceWinding(Communicator.FaceWinding.Clockwise)
        boxMeshData.setBackfacesEnabled(false)
        boxMeshData.addFaces(boxVertices, undefined, undefined, null)

        const boxMeshId = await this._viewer.model.createMesh(boxMeshData)
        const boxMeshInstanceData = new Communicator.MeshInstanceData(
            boxMeshId,
            boxMatrix,
            "box",
            null,
            null,
            null,
            boxCreationFlags
        )
        const boxNodeId = await this._viewer.model.createMeshInstance(
            boxMeshInstanceData
        )

```

---

<div class="post-metadata">

**Author:** ![tino](https://avatars.discourse-cdn.com/v4/letter/t/9dc877/32.png) [@tino](https://forum.techsoft3d.com/u/tino)\
**Post date:** [September 2, 2024, 12:37pm UTC](https://forum.techsoft3d.com/t/how-to-remove-border-on-creating-rectangle-custom-mesh/4008/2 "2024-09-02T12:37:39Z")

</div>

Hello @raja.r,

It looks like the code snippet you referenced is similar to the 3D Text Insertion example included in the _[quickstart](https://docs.techsoft3d.com/communicator/latest/overview/quickstart.html)_ module. Does your code also include the function:

`boxMeshData.addPolyline(lineVertices, void 0);`

Thanks,  
Tino

---

<div class="post-metadata">

**Author:** ![raja.r](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@raja.r](https://forum.techsoft3d.com/u/raja.r)\
**Post date:** [September 2, 2024, 1:36pm UTC](https://forum.techsoft3d.com/t/how-to-remove-border-on-creating-rectangle-custom-mesh/4008/3 "2024-09-02T13:36:13Z")

</div>

no this function not included. what is the lineVertices? for rectangle

---

<div class="post-metadata">

**Author:** ![tino](https://avatars.discourse-cdn.com/v4/letter/t/9dc877/32.png) [@tino](https://forum.techsoft3d.com/u/tino)\
**Post date:** [September 2, 2024, 1:46pm UTC](https://forum.techsoft3d.com/t/how-to-remove-border-on-creating-rectangle-custom-mesh/4008/4 "2024-09-02T13:46:59Z")

</div>

The 3D Text Insertion example is the same as I had referenced in your [previous post](https://forum.techsoft3d.com/t/move-sprite-along-the-surface-of-3d-model-and-also-snapping/3957/4). Are you not able to view this example? The entire code for this example is provided in _HOOPS\_Communicator\_2024.X.0\web\_viewer\examples\scripts\examples\text\_insertion.js_.

A [meshData](https://docs.techsoft3d.com/communicator/latest/api_ref/viewing/classes/Communicator.MeshData.html#Communicator.MeshData) object does not have a polyline by default. So somewhere in your code, you are calling the [addPolyline](https://docs.techsoft3d.com/communicator/latest/api_ref/viewing/classes/Communicator.MeshData.html#Communicator.MeshData.addPolyline) function.
