File indexing completed on 2026-04-09 07:49:43
0001 #pragma once
0002
0003 #include "SPlaceSphere.h"
0004 #include "SPlaceCylinder.h"
0005 #include "SPlaceCircle.h"
0006
0007
0008 struct SPlace
0009 {
0010 static constexpr const char* OPTS = "TR,tr,R,T,r,t" ;
0011 static NP* AroundSphere( const char* opts, double radius, double item_arclen, unsigned num_ring=10 );
0012 static NP* AroundCylinder( const char* opts, double radius, double halfheight , unsigned num_ring=10, unsigned num_in_ring=16 );
0013 static NP* AroundCircle( const char* opts, double radius, unsigned numInRing=4, double fracPhase=0. );
0014 };
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058 NP* SPlace::AroundSphere(const char* opts_, double radius, double item_arclen, unsigned num_ring )
0059 {
0060 const char* opts = opts_ ? opts_ : OPTS ;
0061 SPlaceSphere sp(radius, item_arclen, num_ring);
0062 return sp.transforms(opts) ;
0063 }
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084 NP* SPlace::AroundCylinder(const char* opts_, double radius, double halfheight, unsigned num_ring, unsigned num_in_ring )
0085 {
0086 const char* opts = opts_ ? opts_ : OPTS ;
0087 SPlaceCylinder cy(radius, halfheight, num_ring, num_in_ring );
0088 return cy.transforms(opts) ;
0089 }
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100 NP* SPlace::AroundCircle(const char* opts_, double radius, unsigned numInRing, double fracPhase )
0101 {
0102 const char* opts = opts_ ? opts_ : OPTS ;
0103 SPlaceCircle ci(radius, numInRing, fracPhase );
0104 return ci.transforms(opts) ;
0105 }
0106
0107