Browzwear API

Browzwear API

  • Docs
  • GitLab

›Garment Creation

Introduction

  • Introduction

Getting Started

  • License and Authentication
  • Understanding the API
  • Sample Plugins
  • Creating Python plugin
  • Creating C++ plugin
  • Creating C# plugin
  • Development
  • Deployment

Asset Management

  • Asset Library
  • Colors
  • Material
  • Avatars
  • Garments

Techpack

  • Create a Tech pack
  • Tech pack output - JSON
  • Point of Measurements
  • Bill of Material

Outputs Export

  • Outputs

Garment Creation

  • Create Shape
  • Create Edge
  • Arrange Shape
  • Stitch Shapes
  • Assign Material
  • Create an Avatar
  • Dress a Garment

Colorways

  • Colorways

Smart Design

  • Configure Smart Design Template

Costing

  • Costing

Terms of Use

  • Terms of Use

Change log

  • Change log

Create Edge

Edges is the outline of the shape. Use the Edge API to create, delete edges, set edge properties and so on.

For more information about the feature, please visit here.

To learn more about the rest of the API, please refer to Edge in the repository.

Sample Plugin

Sample plugin for garment creation is available here.

Code Snippet

The code snippet below shows how to add an edge to an existing shape.

Python
C++
C#
# edge starting point
pointStart = BwApi.Point()
pointStart.x = 0
pointStart.y = 0
# sharp point, see BwApiPointType (BWPluginAPI_Types.h) for further information
pointStart.type = BwApi.BW_API_POINT_TYPE_SHARP
# not graded
pointStart.gradeId = -1

# edge ending point
pointEnd = BwApi.Point()
pointEnd.x = 10
pointEnd.y = 0
# sharp point, see BwApiPointType (BWPluginAPI_Types.h) for further information
pointEnd.type = BwApi.BW_API_POINT_TYPE_SHARP
# not graded
pointEnd.gradeId = -1

# create list with all edge points
edgePoints = []
edgePoints.append(pointStart)
edgePoints.append(pointEnd)

# create a new edge, we are passing -1 to the beforeEdgeId param to insert the edge at the end.
edgeId = BwApi.EdgeCreate(garmentId, shapeId, -1, edgePoints)
BwIntVector edgePoints;
// edge starting point
// define non graded (-1) sharp point, see BwApiPointType (BWPluginAPI_Types.h) for further information
edgePoints.add({0, 0, BwApi.BW_API_POINT_TYPE_SHARP, -1});
// edge ending point
// define non graded (-1) sharp point, see BwApiPointType (BWPluginAPI_Types.h) for further information
edgePoints.add({10, 0, BwApi.BW_API_POINT_TYPE_SHARP, -1});

// create a new edge, we are passing -1 to the beforeEdgeId param to insert the edge at the end.
int edgeId = 0;
BwApi.EdgeCreate(garmentId, shapeId, -1, edgePoints, &edgeId);
// edge starting point
pointStart = new Point();
pointStart.x = 0;
pointStart.y = 0;
// sharp point, see BwApiPointType (BWPluginAPI_Types.h) for further information
pointStart.type = PointType.BW_API_POINT_TYPE_SHARP;
// not graded
pointStart.gradeId = -1;

// edge ending point
pointEnd = new Point();
pointEnd.x = 10;
pointEnd.y = 0;
// sharp point, see BwApiPointType (BWPluginAPI_Types.h) for further information
pointEnd.type = PointType.BW_API_POINT_TYPE_SHARP;
// not graded
pointEnd.gradeId = -1;

// create list with all edge points
BwApiVectorPoint edgePoints = new BwApiVectorPoint();
edgePoints.Add(pointStart)
edgePoints.Add(pointEnd)

// create a new edge, we are passing -1 to the beforeEdgeId param to insert the edge at the end.
BwApi.EdgeCreate(garmentId, shapeId, -1, edgePoints, out edgeId)

Result

You will be able to see the shape in the UI only after creating all edges, and closing the shape.

← Create ShapeArrange Shape →
  • Sample Plugin
  • Code Snippet
  • Result
Browzwear API
FIND US
GitLabLinkedinTwitterInstagramFacebook
Copyright © 2021 Browzwear