Difference between revisions of "MGED CMD nmg"

(Created page with "=nmg= __TOC__ ==Syntax== :nmg subcommand object [suffix] ==Argument(s)== <!-- : '''object''' :: Name for the primitive that you want to operate on. : '''S''' :: Plot or out...")
 
m
 
(31 intermediate revisions by one user not shown)
Line 1: Line 1:
=nmg=
+
{{DesignDocument}}
 +
 
 +
=nmg ''design'' =
 
__TOC__
 
__TOC__
  
 
==Syntax==
 
==Syntax==
:nmg subcommand object [suffix]
+
:nmg object subcommand [suffix]
 +
 
 +
==Arguments==
  
==Argument(s)==
 
<!--
 
 
: '''object'''
 
: '''object'''
 
:: Name for the primitive that you want to operate on.
 
:: Name for the primitive that you want to operate on.
  
: '''S'''
+
: '''subcommand'''
:: Plot or output info for a specific 'surface'.
+
:: Command specified to alter an NMG object. Each has it's own set of arguments.
  
: '''F'''
+
==Subcommands==
:: Plot or output info for a specific 'face'.
+
  
: '''T'''
+
: '''mm'''
:: Plot or output info for a specific 'trim'.
+
:: Creates a new NMG model structure and fills the appropriate fields. The result is an empty model.
  
: '''E'''
+
: '''cmface'''
:: Plot or output info for a specific 'edge'.
+
:: Generates a manifold face in the first encountered shell of the NMG object. Vertices are listed as the ''suffix'' and define the winding-order of the face. Faces require at least three specified vertices, each specified by three coordinates. In addition to creating a face, the subcommand will join edges of the new face with dangling edges of other faces in the same shell. This makes it easier for the application to generate topologically correct, closed, manifold objects.
  
: '''SB'''
+
: '''kill V'''
:: Output 'bezier' info for a specific 'surface'.
+
:: Removes the vertexuse and vertex geometry of the selected vertex (via its coordinates). When specifying vertex to be removed, user generally will display vertex coordinates in object via the MGED command [http://brlcad.org/wiki/MGED_CMD_labelvert labelvert]. '''Note: vertex selection via their index number is not currently supported.'''
  
: '''TB'''
+
::For example: 
:: Output 'bezier' info for a specific 'trim'.
+
::: '''mged&gt;''' labelvert myobj 
 +
::: '''mged&gt;''' nmg myobj kill V 0.0 2.537 1.289
  
: '''I'''
+
: '''kill F'''
:: Plot a specific 'iso-surface'.
+
:: Removes the faceuse and face geometry of the selected face (via its index). When specifying the face to be removed, user generally will display face indices in object via the MGED command [http://brlcad.org/wiki/MGED_CMD_labelvert labelface].
  
: '''SN'''
+
::For example: 
:: Plot a specific 'surface normal'.
+
::: '''mged&gt;''' labelface myobj 
 +
::: '''mged&gt;''' nmg myobj kill F 14
  
: '''KN'''
+
: ''' move V ''' ''x_initial y_initial z_initial x_final y_final z_final''
:: Plot a specific 'surface's knots'.
+
:: Moves an existing vertex specified by the coordinates ''x_initial y_initial z_initial'' to the position with coordinates ''x_final y_final z_final''.  
  
: '''F2d'''
+
::For example:
:: Plot a specific 'face' in '2d-space'.
+
::: '''mged&gt;''' nmg myobject move V 1.0 1.0 1.0 2.0 2.0 2.0
  
: '''SBB'''
+
: ''' make V ''' ''vertex-list''
:: Plot a specific 'surface's leafs' (surface tree).
+
:: Creates a new vertex and shell for all vertices, using the ''vertex-list''.  
  
: '''SBB2d'''
+
::For example:
:: Plot a specific 'surface's leafs' in '2d-space'.
+
::: '''mged&gt;''' nmg myobject make V 0 0 0 0 1 0 1 1 0 1 0 0 1 0 1 0 0 1 0 1 1 1 1 1
  
: '''TD'''
+
: ''' make F ''' ''face-list''
:: Plot a specific 'trim direction'.
+
:: Creates face(s) in first encountered region and shell. General usage is to first label vertices with their index number using [[MGED_CMD_labelvert#Proposed_Argument.28s.29 | labelvert -i]].
 +
 +
::For example: 
 +
::: '''mged&gt;''' labelvert -i myobject
 +
::: '''mged&gt;''' nmg myobject make F 4 5 6 7 F 0 1 6 5 F 1 2 7 6 F 2 3 4 7 F 0 5 4 3
  
: '''T2d'''
+
'''Note: index numbers may change after 'make F' command. Thus, execute labelvert witht the -i option before each use of 'make F'.'''
:: Plot a specific 'trim' in '2d-space'.
+
  
: '''TBB'''
 
:: Plot a specific 'trim's leafs' (curve tree).
 
 
: '''TBB2d'''
 
:: Plot a specific 'trim's leafs' in '2d-space'.
 
 
: '''SCV'''
 
:: Plot a specific 'surface's CV'.
 
 
: '''index'''
 
:: The index of the surface (face, edge, etc.) you want to plot or output info for. You can use a single number, 'number-number', or 'all'.
 
 
: '''object2'''
 
:: The other object to intersect 'object'.
 
 
: '''i'''
 
:: Intersect object's ith surface.
 
 
: '''j'''
 
:: Intersect object2's jth surface.
 
 
: '''PP'''
 
:: Point-point intersections.
 
 
: '''PC'''
 
:: Point-curve intersections.
 
 
: '''PS'''
 
:: Point-surface intersections.
 
 
: '''CC'''
 
:: curve-curve intersections.
 
 
: '''CS'''
 
:: curve-surface intersections.
 
 
: '''SS'''
 
:: surface-surface intersections (default).
 
 
: '''brepname'''
 
:: When convert a non-BREP object to BREP, the result BREP's name.
 
 
: '''comb'''
 
:: The comb to be converted to non-evaluated BREP form.
 
 
: '''suffix'''
 
:: The suffix in the generated BREPs' names.
 
-->
 
 
==Return Value(s)==
 
==Return Value(s)==
 
: No Return Values for this command.
 
: No Return Values for this command.
 
  
 
==Description==
 
==Description==
Line 109: Line 66:
 
==Example(s)==
 
==Example(s)==
 
<!--
 
<!--
: '''mged&gt;''' brep obj.brep info F 0
 
:: Output information for the 0th face of obj.brep.
 
: '''mged&gt;''' brep obj.brep plot S 0-2
 
:: Plot the 0th to 2nd surfaces of obj.brep.
 
: '''mged&gt;''' brep sph1.brep intersect sph2.brep 0 0
 
:: Intersect sph1.brep's 0th surface with sph2.brep's 0th surface. (When there's no intersection type specified, we compute SS intersections)
 
 
: '''mged&gt;''' brep obj.s obj.brep
 
: '''mged&gt;''' brep obj.s obj.brep
 
:: Convert implicit primitive obj.s to BREP form named obj.brep.
 
:: Convert implicit primitive obj.s to BREP form named obj.brep.
 
-->
 
-->
 +
 +
: '''mged&gt;''' nmg cube mm
 +
:: Creates an empty NMG object.
 +
: '''mged&gt;''' nmg cube cmface 0 0 0 0 1 0 1 1 0 1 0 0
 +
:: Creates 1st face of a six-sided cube.
 +
: '''mged&gt;''' nmg cube cmface 1 0 1 0 0 1 0 1 1 1 1 1
 +
:: Creates 2nd face of a six-sided cube.
 +
: '''mged&gt;''' nmg cube cmface 0 0 0 0 1 0 0 1 1 0 0 1
 +
:: Creates 3rd face of a six-sided cube.
 +
: '''mged&gt;''' nmg cube cmface 0 1 0 1 1 0 1 1 1 0 1 1
 +
:: Creates 4th face of a six-sided cube.
 +
: '''mged&gt;''' nmg cube cmface 1 1 0 1 0 0 1 0 1 1 1 1 
 +
:: Creates 5th face of a six-sided cube.
 +
: '''mged&gt;''' nmg cube cmface 0 0 0 0 0 1 1 0 1 1 0 0
 +
:: Creates 6th face of a six-sided cube.
  
 
==See Also==
 
==See Also==
 +
: [http://brlcad.org/wiki/NMG_Editing NMG Editing] project idea page
 
: [http://brlcad.org/wiki/NMG put] for use with NMG objects
 
: [http://brlcad.org/wiki/NMG put] for use with NMG objects
: [http://brlcad.org/wiki/MGED_CMD_brep brep]
+
: [http://brlcad.org/wiki/MGED_CMD_brep brep] command
 +
: Wikipedia article on [https://en.wikipedia.org/wiki/Polygon_mesh polygon mesh]

Latest revision as of 23:40, 22 August 2015

Design icon.png This page contains the design document for an enhancement or feature. The design should be considered a work in progress and may not represent the final design. As this is a collaborative design, contributions and participation from other developers and users is encouraged. Use the discussion page for providing comments and suggestions.


nmg design[edit]

Syntax[edit]

nmg object subcommand [suffix]

Arguments[edit]

object
Name for the primitive that you want to operate on.
subcommand
Command specified to alter an NMG object. Each has it's own set of arguments.

Subcommands[edit]

mm
Creates a new NMG model structure and fills the appropriate fields. The result is an empty model.
cmface
Generates a manifold face in the first encountered shell of the NMG object. Vertices are listed as the suffix and define the winding-order of the face. Faces require at least three specified vertices, each specified by three coordinates. In addition to creating a face, the subcommand will join edges of the new face with dangling edges of other faces in the same shell. This makes it easier for the application to generate topologically correct, closed, manifold objects.
kill V
Removes the vertexuse and vertex geometry of the selected vertex (via its coordinates). When specifying vertex to be removed, user generally will display vertex coordinates in object via the MGED command labelvert. Note: vertex selection via their index number is not currently supported.
For example:
mged> labelvert myobj
mged> nmg myobj kill V 0.0 2.537 1.289
kill F
Removes the faceuse and face geometry of the selected face (via its index). When specifying the face to be removed, user generally will display face indices in object via the MGED command labelface.
For example:
mged> labelface myobj
mged> nmg myobj kill F 14
move V x_initial y_initial z_initial x_final y_final z_final
Moves an existing vertex specified by the coordinates x_initial y_initial z_initial to the position with coordinates x_final y_final z_final.
For example:
mged> nmg myobject move V 1.0 1.0 1.0 2.0 2.0 2.0
make V vertex-list
Creates a new vertex and shell for all vertices, using the vertex-list.
For example:
mged> nmg myobject make V 0 0 0 0 1 0 1 1 0 1 0 0 1 0 1 0 0 1 0 1 1 1 1 1
make F face-list
Creates face(s) in first encountered region and shell. General usage is to first label vertices with their index number using labelvert -i.
For example:
mged> labelvert -i myobject
mged> nmg myobject make F 4 5 6 7 F 0 1 6 5 F 1 2 7 6 F 2 3 4 7 F 0 5 4 3

Note: index numbers may change after 'make F' command. Thus, execute labelvert witht the -i option before each use of 'make F'.

Return Value(s)[edit]

No Return Values for this command.

Description[edit]

The "nmg" command is a command for creating, adding geometry, and manipulating NMG objects in BRL-CAD. All operations are result in the addition of manifold geometry to the object.

Example(s)[edit]

mged> nmg cube mm
Creates an empty NMG object.
mged> nmg cube cmface 0 0 0 0 1 0 1 1 0 1 0 0
Creates 1st face of a six-sided cube.
mged> nmg cube cmface 1 0 1 0 0 1 0 1 1 1 1 1
Creates 2nd face of a six-sided cube.
mged> nmg cube cmface 0 0 0 0 1 0 0 1 1 0 0 1
Creates 3rd face of a six-sided cube.
mged> nmg cube cmface 0 1 0 1 1 0 1 1 1 0 1 1
Creates 4th face of a six-sided cube.
mged> nmg cube cmface 1 1 0 1 0 0 1 0 1 1 1 1
Creates 5th face of a six-sided cube.
mged> nmg cube cmface 0 0 0 0 0 1 1 0 1 1 0 0
Creates 6th face of a six-sided cube.

See Also[edit]

NMG Editing project idea page
put for use with NMG objects
brep command
Wikipedia article on polygon mesh