scriptup 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +11 -0
  3. data/README.md +5 -0
  4. data/ext/attribute_dictionaries.c +45 -0
  5. data/ext/attribute_dictionaries.h +3 -0
  6. data/ext/attribute_dictionary.c +156 -0
  7. data/ext/attribute_dictionary.h +3 -0
  8. data/ext/behavior.c +10 -0
  9. data/ext/behavior.h +3 -0
  10. data/ext/color.c +211 -0
  11. data/ext/color.h +3 -0
  12. data/ext/component_definition.c +188 -0
  13. data/ext/component_definition.h +3 -0
  14. data/ext/component_instance.c +10 -0
  15. data/ext/component_instance.h +3 -0
  16. data/ext/definition_list.c +145 -0
  17. data/ext/definition_list.h +3 -0
  18. data/ext/drawing_element.c +10 -0
  19. data/ext/drawing_element.h +3 -0
  20. data/ext/entities.c +11 -0
  21. data/ext/entities.h +3 -0
  22. data/ext/entity.c +253 -0
  23. data/ext/entity.h +3 -0
  24. data/ext/extconf.rb +38 -0
  25. data/ext/material.c +242 -0
  26. data/ext/material.h +3 -0
  27. data/ext/materials.c +80 -0
  28. data/ext/materials.h +3 -0
  29. data/ext/model.c +42 -0
  30. data/ext/model.h +3 -0
  31. data/ext/sketchup.c +89 -0
  32. data/ext/sketchup.h +4 -0
  33. data/ext/texture.c +9 -0
  34. data/ext/texture.h +3 -0
  35. data/ext/typed_value.c +84 -0
  36. data/ext/typed_value.h +5 -0
  37. data/ext/utils.h +80 -0
  38. data/lib/sketchup.rb +12 -0
  39. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/application.h +36 -0
  40. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/model.h +59 -0
  41. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/overlay.h +248 -0
  42. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/ruby_api.h +118 -0
  43. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/color.h +107 -0
  44. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/common.h +178 -0
  45. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/defs.h +19 -0
  46. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/extension_license.h +62 -0
  47. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/bounding_box.h +34 -0
  48. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/plane3d.h +153 -0
  49. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/point2d.h +96 -0
  50. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/point3d.h +98 -0
  51. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/ray3d.h +64 -0
  52. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/transformation.h +321 -0
  53. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/transformation2d.h +163 -0
  54. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/vector2d.h +235 -0
  55. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/vector3d.h +285 -0
  56. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry.h +152 -0
  57. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/import_export/modelexporterplugin.h +165 -0
  58. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/import_export/modelimporterplugin.h +183 -0
  59. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/import_export/pluginprogresscallback.h +84 -0
  60. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/initialize.h +43 -0
  61. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/length_formatter.h +424 -0
  62. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/arccurve.h +244 -0
  63. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/arrow_type.h +17 -0
  64. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/attribute_dictionary.h +161 -0
  65. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/axes.h +242 -0
  66. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/camera.h +398 -0
  67. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/classification_attribute.h +89 -0
  68. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/classification_info.h +125 -0
  69. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/classifications.h +86 -0
  70. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/component_definition.h +588 -0
  71. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/component_instance.h +344 -0
  72. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/curve.h +143 -0
  73. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/defs.h +142 -0
  74. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dimension.h +222 -0
  75. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dimension_linear.h +421 -0
  76. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dimension_radial.h +194 -0
  77. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dimension_style.h +253 -0
  78. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/drawing_element.h +198 -0
  79. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dynamic_component_attribute.h +92 -0
  80. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dynamic_component_info.h +70 -0
  81. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/edge.h +271 -0
  82. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/edge_use.h +214 -0
  83. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entities.h +834 -0
  84. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entity.h +186 -0
  85. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entity_list.h +80 -0
  86. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entity_list_iterator.h +90 -0
  87. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/face.h +686 -0
  88. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/font.h +138 -0
  89. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/geometry.h +20 -0
  90. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/geometry_input.h +685 -0
  91. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/group.h +244 -0
  92. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/guide_line.h +155 -0
  93. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/guide_point.h +153 -0
  94. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/image.h +288 -0
  95. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/image_rep.h +275 -0
  96. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/instancepath.h +266 -0
  97. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/layer.h +265 -0
  98. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/layer_folder.h +301 -0
  99. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/line_style.h +211 -0
  100. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/line_styles.h +81 -0
  101. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/location.h +65 -0
  102. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/loop.h +182 -0
  103. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/material.h +390 -0
  104. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/mesh_helper.h +187 -0
  105. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/model.h +1663 -0
  106. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/model_version.h +49 -0
  107. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/opening.h +72 -0
  108. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/options_manager.h +79 -0
  109. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/options_provider.h +166 -0
  110. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/polyline3d.h +140 -0
  111. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/rendering_options.h +179 -0
  112. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/scene.h +836 -0
  113. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/schema.h +56 -0
  114. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/schema_type.h +26 -0
  115. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/section_plane.h +212 -0
  116. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/selection.h +156 -0
  117. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/shadow_info.h +147 -0
  118. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/skp.h +45 -0
  119. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/style.h +303 -0
  120. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/styles.h +190 -0
  121. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/text.h +384 -0
  122. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/texture.h +358 -0
  123. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/texture_writer.h +280 -0
  124. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/typed_value.h +390 -0
  125. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/uv_helper.h +79 -0
  126. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/vertex.h +154 -0
  127. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/sketchup.h +122 -0
  128. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/sketchup_info.h +65 -0
  129. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/slapi.h +16 -0
  130. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/transformation.h +16 -0
  131. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/unicodestring.h +239 -0
  132. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/utils/math_helpers.h +124 -0
  133. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonGeometry.dylib +0 -0
  134. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonGeoutils.dylib +0 -0
  135. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonImage.dylib +0 -0
  136. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonPreferences.dylib +0 -0
  137. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonUnits.dylib +0 -0
  138. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonUtils.dylib +0 -0
  139. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonZip.dylib +0 -0
  140. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Resources/Info.plist +50 -0
  141. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/SketchUpAPI +0 -0
  142. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/_CodeSignature/CodeResources +835 -0
  143. data/sketchup-sdk-win/binaries/sketchup/x64/SketchUpAPI.dll +0 -0
  144. data/sketchup-sdk-win/binaries/sketchup/x64/SketchUpAPI.lib +0 -0
  145. data/sketchup-sdk-win/binaries/sketchup/x64/SketchUpCommonPreferences.dll +0 -0
  146. data/sketchup-sdk-win/binaries/sketchup/x64/sketchup.lib +0 -0
  147. data/sketchup-sdk-win/headers/SketchUpAPI/application/application.h +36 -0
  148. data/sketchup-sdk-win/headers/SketchUpAPI/application/model.h +59 -0
  149. data/sketchup-sdk-win/headers/SketchUpAPI/application/overlay.h +248 -0
  150. data/sketchup-sdk-win/headers/SketchUpAPI/application/ruby_api.h +118 -0
  151. data/sketchup-sdk-win/headers/SketchUpAPI/color.h +107 -0
  152. data/sketchup-sdk-win/headers/SketchUpAPI/common.h +178 -0
  153. data/sketchup-sdk-win/headers/SketchUpAPI/defs.h +19 -0
  154. data/sketchup-sdk-win/headers/SketchUpAPI/extension_license.h +62 -0
  155. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/bounding_box.h +34 -0
  156. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/plane3d.h +153 -0
  157. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/point2d.h +96 -0
  158. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/point3d.h +98 -0
  159. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/ray3d.h +64 -0
  160. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/transformation.h +321 -0
  161. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/transformation2d.h +163 -0
  162. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/vector2d.h +235 -0
  163. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/vector3d.h +285 -0
  164. data/sketchup-sdk-win/headers/SketchUpAPI/geometry.h +152 -0
  165. data/sketchup-sdk-win/headers/SketchUpAPI/import_export/modelexporterplugin.h +165 -0
  166. data/sketchup-sdk-win/headers/SketchUpAPI/import_export/modelimporterplugin.h +183 -0
  167. data/sketchup-sdk-win/headers/SketchUpAPI/import_export/pluginprogresscallback.h +84 -0
  168. data/sketchup-sdk-win/headers/SketchUpAPI/initialize.h +43 -0
  169. data/sketchup-sdk-win/headers/SketchUpAPI/length_formatter.h +424 -0
  170. data/sketchup-sdk-win/headers/SketchUpAPI/model/arccurve.h +244 -0
  171. data/sketchup-sdk-win/headers/SketchUpAPI/model/arrow_type.h +17 -0
  172. data/sketchup-sdk-win/headers/SketchUpAPI/model/attribute_dictionary.h +161 -0
  173. data/sketchup-sdk-win/headers/SketchUpAPI/model/axes.h +242 -0
  174. data/sketchup-sdk-win/headers/SketchUpAPI/model/camera.h +398 -0
  175. data/sketchup-sdk-win/headers/SketchUpAPI/model/classification_attribute.h +89 -0
  176. data/sketchup-sdk-win/headers/SketchUpAPI/model/classification_info.h +125 -0
  177. data/sketchup-sdk-win/headers/SketchUpAPI/model/classifications.h +86 -0
  178. data/sketchup-sdk-win/headers/SketchUpAPI/model/component_definition.h +588 -0
  179. data/sketchup-sdk-win/headers/SketchUpAPI/model/component_instance.h +344 -0
  180. data/sketchup-sdk-win/headers/SketchUpAPI/model/curve.h +143 -0
  181. data/sketchup-sdk-win/headers/SketchUpAPI/model/defs.h +142 -0
  182. data/sketchup-sdk-win/headers/SketchUpAPI/model/dimension.h +222 -0
  183. data/sketchup-sdk-win/headers/SketchUpAPI/model/dimension_linear.h +421 -0
  184. data/sketchup-sdk-win/headers/SketchUpAPI/model/dimension_radial.h +194 -0
  185. data/sketchup-sdk-win/headers/SketchUpAPI/model/dimension_style.h +253 -0
  186. data/sketchup-sdk-win/headers/SketchUpAPI/model/drawing_element.h +198 -0
  187. data/sketchup-sdk-win/headers/SketchUpAPI/model/dynamic_component_attribute.h +92 -0
  188. data/sketchup-sdk-win/headers/SketchUpAPI/model/dynamic_component_info.h +70 -0
  189. data/sketchup-sdk-win/headers/SketchUpAPI/model/edge.h +271 -0
  190. data/sketchup-sdk-win/headers/SketchUpAPI/model/edge_use.h +214 -0
  191. data/sketchup-sdk-win/headers/SketchUpAPI/model/entities.h +834 -0
  192. data/sketchup-sdk-win/headers/SketchUpAPI/model/entity.h +186 -0
  193. data/sketchup-sdk-win/headers/SketchUpAPI/model/entity_list.h +80 -0
  194. data/sketchup-sdk-win/headers/SketchUpAPI/model/entity_list_iterator.h +90 -0
  195. data/sketchup-sdk-win/headers/SketchUpAPI/model/face.h +686 -0
  196. data/sketchup-sdk-win/headers/SketchUpAPI/model/font.h +138 -0
  197. data/sketchup-sdk-win/headers/SketchUpAPI/model/geometry.h +20 -0
  198. data/sketchup-sdk-win/headers/SketchUpAPI/model/geometry_input.h +685 -0
  199. data/sketchup-sdk-win/headers/SketchUpAPI/model/group.h +244 -0
  200. data/sketchup-sdk-win/headers/SketchUpAPI/model/guide_line.h +155 -0
  201. data/sketchup-sdk-win/headers/SketchUpAPI/model/guide_point.h +153 -0
  202. data/sketchup-sdk-win/headers/SketchUpAPI/model/image.h +288 -0
  203. data/sketchup-sdk-win/headers/SketchUpAPI/model/image_rep.h +275 -0
  204. data/sketchup-sdk-win/headers/SketchUpAPI/model/instancepath.h +266 -0
  205. data/sketchup-sdk-win/headers/SketchUpAPI/model/layer.h +265 -0
  206. data/sketchup-sdk-win/headers/SketchUpAPI/model/layer_folder.h +301 -0
  207. data/sketchup-sdk-win/headers/SketchUpAPI/model/line_style.h +211 -0
  208. data/sketchup-sdk-win/headers/SketchUpAPI/model/line_styles.h +81 -0
  209. data/sketchup-sdk-win/headers/SketchUpAPI/model/location.h +65 -0
  210. data/sketchup-sdk-win/headers/SketchUpAPI/model/loop.h +182 -0
  211. data/sketchup-sdk-win/headers/SketchUpAPI/model/material.h +390 -0
  212. data/sketchup-sdk-win/headers/SketchUpAPI/model/mesh_helper.h +187 -0
  213. data/sketchup-sdk-win/headers/SketchUpAPI/model/model.h +1663 -0
  214. data/sketchup-sdk-win/headers/SketchUpAPI/model/model_version.h +49 -0
  215. data/sketchup-sdk-win/headers/SketchUpAPI/model/opening.h +72 -0
  216. data/sketchup-sdk-win/headers/SketchUpAPI/model/options_manager.h +79 -0
  217. data/sketchup-sdk-win/headers/SketchUpAPI/model/options_provider.h +166 -0
  218. data/sketchup-sdk-win/headers/SketchUpAPI/model/polyline3d.h +140 -0
  219. data/sketchup-sdk-win/headers/SketchUpAPI/model/rendering_options.h +179 -0
  220. data/sketchup-sdk-win/headers/SketchUpAPI/model/scene.h +836 -0
  221. data/sketchup-sdk-win/headers/SketchUpAPI/model/schema.h +56 -0
  222. data/sketchup-sdk-win/headers/SketchUpAPI/model/schema_type.h +26 -0
  223. data/sketchup-sdk-win/headers/SketchUpAPI/model/section_plane.h +212 -0
  224. data/sketchup-sdk-win/headers/SketchUpAPI/model/selection.h +156 -0
  225. data/sketchup-sdk-win/headers/SketchUpAPI/model/shadow_info.h +147 -0
  226. data/sketchup-sdk-win/headers/SketchUpAPI/model/skp.h +45 -0
  227. data/sketchup-sdk-win/headers/SketchUpAPI/model/style.h +303 -0
  228. data/sketchup-sdk-win/headers/SketchUpAPI/model/styles.h +190 -0
  229. data/sketchup-sdk-win/headers/SketchUpAPI/model/text.h +384 -0
  230. data/sketchup-sdk-win/headers/SketchUpAPI/model/texture.h +358 -0
  231. data/sketchup-sdk-win/headers/SketchUpAPI/model/texture_writer.h +280 -0
  232. data/sketchup-sdk-win/headers/SketchUpAPI/model/typed_value.h +390 -0
  233. data/sketchup-sdk-win/headers/SketchUpAPI/model/uv_helper.h +79 -0
  234. data/sketchup-sdk-win/headers/SketchUpAPI/model/vertex.h +154 -0
  235. data/sketchup-sdk-win/headers/SketchUpAPI/sketchup.h +122 -0
  236. data/sketchup-sdk-win/headers/SketchUpAPI/sketchup_info.h +65 -0
  237. data/sketchup-sdk-win/headers/SketchUpAPI/slapi.h +16 -0
  238. data/sketchup-sdk-win/headers/SketchUpAPI/transformation.h +16 -0
  239. data/sketchup-sdk-win/headers/SketchUpAPI/unicodestring.h +239 -0
  240. data/sketchup-sdk-win/headers/SketchUpAPI/utils/math_helpers.h +124 -0
  241. metadata +313 -0
@@ -0,0 +1,686 @@
1
+ // Copyright 2013-2021 Trimble Inc. All Rights Reserved.
2
+
3
+ /**
4
+ * @file
5
+ * @brief Interfaces for SUFaceRef.
6
+ */
7
+ #ifndef SKETCHUP_MODEL_FACE_H_
8
+ #define SKETCHUP_MODEL_FACE_H_
9
+
10
+ #include <SketchUpAPI/common.h>
11
+ #include <SketchUpAPI/geometry.h>
12
+ #include <SketchUpAPI/transformation.h>
13
+ #include <SketchUpAPI/model/geometry_input.h>
14
+ #include <SketchUpAPI/model/defs.h>
15
+
16
+ // Forward declarations
17
+
18
+ #ifdef __cplusplus
19
+ extern "C" {
20
+ #endif
21
+
22
+ /**
23
+ @struct SUFaceRef
24
+ @extends SUDrawingElementRef
25
+ @brief References a face.
26
+ */
27
+
28
+ /**
29
+ @brief Converts from an \ref SUFaceRef to an \ref SUEntityRef.
30
+ This is essentially an upcast operation.
31
+ @param[in] face The given face reference.
32
+ @related SUFaceRef
33
+ @return
34
+ - The converted SUEntityRef if face is a valid face.
35
+ - If not, the returned reference will be invalid.
36
+ */
37
+ SU_EXPORT SUEntityRef SUFaceToEntity(SUFaceRef face);
38
+
39
+ /**
40
+ @brief Converts from an \ref SUEntityRef to an \ref SUFaceRef.
41
+ This is essentially a downcast operation so the given entity must be
42
+ convertible to an \ref SUFaceRef.
43
+ @param[in] entity The given entity reference.
44
+ @related SUFaceRef
45
+ @return
46
+ - The converted SUFaceRef if the downcast operation succeeds
47
+ - If not, the returned reference will be invalid
48
+ */
49
+ SU_EXPORT SUFaceRef SUFaceFromEntity(SUEntityRef entity);
50
+
51
+ /**
52
+ @brief Converts from an \ref SUFaceRef to an \ref SUDrawingElementRef.
53
+ This is essentially an upcast operation.
54
+ @param[in] face The given face reference.
55
+ @related SUFaceRef
56
+ @return
57
+ - The converted \ref SUEntityRef if face is a valid face.
58
+ - If not, the returned reference will be invalid.
59
+ */
60
+ SU_EXPORT SUDrawingElementRef SUFaceToDrawingElement(SUFaceRef face);
61
+
62
+ /**
63
+ @brief Converts from an \ref SUDrawingElementRef to an \ref SUFaceRef.
64
+ This is essentially a downcast operation so the given element must be
65
+ convertible to an SUFaceRef.
66
+ @param[in] drawing_elem The given element reference.
67
+ @related SUFaceRef
68
+ @return
69
+ - The converted \ref SUFaceRef if the downcast operation succeeds
70
+ - If not, the returned reference will be invalid
71
+ */
72
+ SU_EXPORT SUFaceRef SUFaceFromDrawingElement(SUDrawingElementRef drawing_elem);
73
+
74
+ /**
75
+ @brief Creates a face without holes.
76
+
77
+ @bug SUEntitiesAddFaces() will not merge overlapping vertices and edges, which
78
+ produces SketchUp models with unexpected state. Avoid using these functions
79
+ and instead use SUGeometryInputRef along with SUEntitiesFill().
80
+
81
+ @param[out] face The face object created.
82
+ @param[in] vertices3d The array of vertices that make the face.
83
+ @param[in] outer_loop The loop input that describes the outer loop of the face.
84
+ If the function is successful, the new face will take
85
+ ownership of the loop and this reference will be
86
+ invalidated.
87
+ @related SUFaceRef
88
+ @return
89
+ - \ref SU_ERROR_NONE on success
90
+ - \ref SU_ERROR_NULL_POINTER_INPUT if vertices3d or outer_loop is NULL
91
+ - \ref SU_ERROR_INVALID_INPUT if outer_loop contains invalid input data
92
+ - \ref SU_ERROR_GENERIC if the the points specified by outer_loop do not lie on
93
+ a plane within 1.0e-3 tolerance
94
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if face is NULL
95
+ - \ref SU_ERROR_OVERWRITE_VALID if face already refers to a valid object
96
+ */
97
+ SU_RESULT SUFaceCreate(
98
+ SUFaceRef* face, const struct SUPoint3D vertices3d[], SULoopInputRef* outer_loop);
99
+
100
+ /**
101
+ @brief Creates a simple face without holes from an array of vertices.
102
+
103
+ @bug SUEntitiesAddFaces() will not merge overlapping vertices and edges, which
104
+ produces SketchUp models with unexpected state. Avoid using these functions
105
+ and instead use SUGeometryInputRef along with SUEntitiesFill().
106
+
107
+ @param[out] face The face object created.
108
+ @param[in] vertices3d The array of vertices of the face.
109
+ @param[in] len The length of the array of vertices.
110
+ @related SUFaceRef
111
+ @return
112
+ - \ref SU_ERROR_NONE on success
113
+ - \ref SU_ERROR_NULL_POINTER_INPUT if vertices3d is NULL
114
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if face is NULL
115
+ - \ref SU_ERROR_GENERIC if the specified vertices do not lie on a plane within
116
+ 1.0e-3 tolerance
117
+ - \ref SU_ERROR_OVERWRITE_VALID if face already refers to a valid face object
118
+ */
119
+ SU_RESULT SUFaceCreateSimple(SUFaceRef* face, const struct SUPoint3D vertices3d[], size_t len);
120
+
121
+ /**
122
+ @brief Retrieves the normal vector of a face object.
123
+ @param[in] face The face object.
124
+ @param[out] normal The 3d normal vector retrieved.
125
+ @related SUFaceRef
126
+ @return
127
+ - \ref SU_ERROR_NONE on success
128
+ - \ref SU_ERROR_INVALID_INPUT if face is not a valid object
129
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if normal is NULL
130
+ */
131
+ SU_RESULT SUFaceGetNormal(SUFaceRef face, struct SUVector3D* normal);
132
+
133
+ /**
134
+ @brief Releases a face object and its associated resources.
135
+ @param[in] face The face object.
136
+ @related SUFaceRef
137
+ @return
138
+ - \ref SU_ERROR_NONE on success
139
+ - \ref SU_ERROR_NULL_POINTER_INPUT if face points to an NULL
140
+ - \ref SU_ERROR_INVALID_INPUT if the face object is not a valid object.
141
+ */
142
+ SU_RESULT SUFaceRelease(SUFaceRef* face);
143
+
144
+ /**
145
+ @brief Retrieves the number of edges in a face.
146
+ @param[in] face The face object.
147
+ @param[out] count The number of edges.
148
+ @related SUFaceRef
149
+ @return
150
+ - \ref SU_ERROR_NONE on success
151
+ - \ref SU_ERROR_INVALID_INPUT if the face is not a valid object
152
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL
153
+ */
154
+ SU_RESULT SUFaceGetNumEdges(SUFaceRef face, size_t* count);
155
+
156
+ /**
157
+ @brief Retrieves the edges in the face.
158
+ @param[in] face The face object.
159
+ @param[in] len The number of edges to retrieve.
160
+ @param[out] edges The edges retrieved.
161
+ @param[out] count The number of edges retrieved.
162
+ @related SUFaceRef
163
+ @return
164
+ - \ref SU_ERROR_NONE on success
165
+ - \ref SU_ERROR_INVALID_INPUT if face is not a valid object
166
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if edges or count is NULL
167
+ */
168
+ SU_RESULT SUFaceGetEdges(SUFaceRef face, size_t len, SUEdgeRef edges[], size_t* count);
169
+
170
+ /**
171
+ @brief Retrieves the number of edge uses in a face.
172
+ @since SketchUp 2016, API 4.0
173
+ @param[in] face The face object.
174
+ @param[out] count The number of edge uses.
175
+ @related SUFaceRef
176
+ @return
177
+ - \ref SU_ERROR_NONE on success
178
+ - \ref SU_ERROR_INVALID_INPUT if the face is not a valid object
179
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL
180
+ */
181
+ SU_RESULT SUFaceGetNumEdgeUses(SUFaceRef face, size_t* count);
182
+
183
+ /**
184
+ @brief Retrieves the edge uses in the face.
185
+ @since SketchUp 2016, API 4.0
186
+ @param[in] face The face object.
187
+ @param[in] len The number of edge uses to retrieve.
188
+ @param[out] edges The edgeuses retrieved.
189
+ @param[out] count The number of edge uses retrieved.
190
+ @related SUFaceRef
191
+ @return
192
+ - \ref SU_ERROR_NONE on success
193
+ - \ref SU_ERROR_INVALID_INPUT if face is not a valid object
194
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if edges or count is NULL
195
+ */
196
+ SU_RESULT SUFaceGetEdgeUses(SUFaceRef face, size_t len, SUEdgeUseRef edges[], size_t* count);
197
+
198
+ /**
199
+ @brief Retrieves the plane of the face.
200
+ @param[in] face The face object.
201
+ @param[out] plane The 3d plane retrieved.
202
+ @related SUFaceRef
203
+ @return
204
+ - \ref SU_ERROR_NONE on success
205
+ - \ref SU_ERROR_INVALID_INPUT if face is not a valid object
206
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if plane is NULL
207
+ */
208
+ SU_RESULT SUFaceGetPlane(SUFaceRef face, struct SUPlane3D* plane);
209
+
210
+ /**
211
+ @brief Retrieves the number of vertices that the face is associated with.
212
+ @param[in] face The face object.
213
+ @param[out] count The number of vertices.
214
+ @related SUFaceRef
215
+ @return
216
+ - \ref SU_ERROR_NONE on success
217
+ - \ref SU_ERROR_INVALID_INPUT if face is not a valid object
218
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL
219
+ */
220
+ SU_RESULT SUFaceGetNumVertices(SUFaceRef face, size_t* count);
221
+
222
+ /**
223
+ @brief Retrieves the vertex objects associated with a face object.
224
+ @param[in] face The face object.
225
+ @param[in] len The number of vertices to retrieve.
226
+ @param[out] vertices The vertices retrieved.
227
+ @param[out] count The number of vertices retrieved.
228
+ @related SUFaceRef
229
+ @return
230
+ - \ref SU_ERROR_NONE on success
231
+ - \ref SU_ERROR_INVALID_INPUT if face is not a valid object
232
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if vertices or count is NULL
233
+ */
234
+ SU_RESULT SUFaceGetVertices(SUFaceRef face, size_t len, SUVertexRef vertices[], size_t* count);
235
+
236
+ /**
237
+ @brief Retrieves the outer loop of a face object.
238
+ @param[in] face The face object.
239
+ @param[out] loop The loop object retrieved.
240
+ @related SUFaceRef
241
+ @return
242
+ - \ref SU_ERROR_NONE on success
243
+ - \ref SU_ERROR_INVALID_INPUT if face is not a valid object
244
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if loop is NULL
245
+ - \ref SU_ERROR_OVERWRITE_VALID if loop already refers to a valid object
246
+ */
247
+ SU_RESULT SUFaceGetOuterLoop(SUFaceRef face, SULoopRef* loop);
248
+
249
+ /**
250
+ @brief Retrieves the number of loops in a face.
251
+ @param[in] face The face object.
252
+ @param[out] count The number of inner loops.
253
+ @related SUFaceRef
254
+ @return
255
+ - \ref SU_ERROR_NONE on success
256
+ - \ref SU_ERROR_INVALID_INPUT if the face is not a valid object
257
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL
258
+ */
259
+ SU_RESULT SUFaceGetNumInnerLoops(SUFaceRef face, size_t* count);
260
+
261
+ /**
262
+ @brief Retrieves the loops in the face.
263
+ @param[in] face The face object.
264
+ @param[in] len The number of loops to retrieve.
265
+ @param[out] loops The inner loops retrieved.
266
+ @param[out] count The number of inner loops retrieved.
267
+ @related SUFaceRef
268
+ @return
269
+ - \ref SU_ERROR_NONE on success
270
+ - \ref SU_ERROR_INVALID_INPUT if face object is not a valid object
271
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if loops or count is NULL
272
+ */
273
+ SU_RESULT SUFaceGetInnerLoops(SUFaceRef face, size_t len, SULoopRef loops[], size_t* count);
274
+
275
+ /**
276
+ @brief Adds a hole to the face. The face object must be associated with a parent
277
+ component.
278
+ @param[in] face The face object.
279
+ @param[in] vertices3d The array of vertices references by the added loop.
280
+ @param[in] loop The loop input that describes the inner loop.
281
+ If the function is successful, the new face will take
282
+ ownership of the loop and this reference will be
283
+ invalidated.
284
+ @related SUFaceRef
285
+ @return
286
+ - \ref SU_ERROR_NONE on success
287
+ - \ref SU_ERROR_NULL_POINTER_INPUT if vertices3d or loop is NULL
288
+ - \ref SU_ERROR_INVALID_INPUT if loop contains invalid input data
289
+ - \ref SU_ERROR_GENERIC if the face object is not associated with a parent
290
+ component.
291
+ */
292
+ SU_RESULT SUFaceAddInnerLoop(
293
+ SUFaceRef face, const struct SUPoint3D vertices3d[], SULoopInputRef* loop);
294
+
295
+ /**
296
+ @brief Retrieves the number of openings in a face.
297
+ @since SketchUp 2014, API 2.0
298
+ @param[in] face The face object.
299
+ @param[out] count The number of openings.
300
+ @related SUFaceRef
301
+ @return
302
+ - \ref SU_ERROR_NONE on success
303
+ - \ref SU_ERROR_INVALID_INPUT if the face is not a valid object
304
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL
305
+ */
306
+ SU_RESULT SUFaceGetNumOpenings(SUFaceRef face, size_t* count);
307
+
308
+ /**
309
+ @brief Retrieves the openings in the face. The retrieved SUOpeningRef() objects
310
+ must be manually released by calling SUOpeningRelease() on each one.
311
+ @since SketchUp 2014, API 2.0
312
+ @param[in] face The face object.
313
+ @param[in] len The number of openings to retrieve.
314
+ @param[out] openings The openings retrieved.
315
+ @param[out] count The number of openings retrieved.
316
+ @related SUFaceRef
317
+ @return
318
+ - \ref SU_ERROR_NONE on success
319
+ - \ref SU_ERROR_INVALID_INPUT if face is not a valid object
320
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if openings or count is NULL
321
+ */
322
+ SU_RESULT SUFaceGetOpenings(SUFaceRef face, size_t len, SUOpeningRef openings[], size_t* count);
323
+ /**
324
+ @brief Retrieves the front material associated with a face object.
325
+ @param[in] face The face object.
326
+ @param[out] material The material object retrieved.
327
+ @related SUFaceRef
328
+ @return
329
+ - \ref SU_ERROR_NONE on success
330
+ - \ref SU_ERROR_INVALID_INPUT if face is not a valid object
331
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if material is NULL
332
+ */
333
+ SU_RESULT SUFaceGetFrontMaterial(SUFaceRef face, SUMaterialRef* material);
334
+
335
+ /**
336
+ @brief Sets the front material of a face object.
337
+ @param[in] face The face object.
338
+ @param[in] material The material object to set. If invalid, this will set the
339
+ material to the default material.
340
+ @related SUFaceRef
341
+ @return
342
+ - \ref SU_ERROR_NONE on success
343
+ - \ref SU_ERROR_INVALID_INPUT if face is not a valid object
344
+ - \ref SU_ERROR_INVALID_ARGUMENT is the material is owned by a layer or image
345
+ */
346
+ SU_RESULT SUFaceSetFrontMaterial(SUFaceRef face, SUMaterialRef material);
347
+
348
+ /**
349
+ @brief Retrieves the back material associate with a face object.
350
+ @param[in] face The face object.
351
+ @param[out] material The material object retrieved.
352
+ @related SUFaceRef
353
+ @return
354
+ - \ref SU_ERROR_NONE on success
355
+ - \ref SU_ERROR_INVALID_INPUT if face is not a valid object
356
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if material is NULL
357
+ - \ref SU_ERROR_INVALID_ARGUMENT is the material is owned by a layer or image
358
+ */
359
+ SU_RESULT SUFaceGetBackMaterial(SUFaceRef face, SUMaterialRef* material);
360
+
361
+ /**
362
+ @brief Sets the back material of a face object.
363
+ @param[in] face The face object.
364
+ @param[in] material The material object to set. If invalid, this will set the
365
+ material to the default material.
366
+ @related SUFaceRef
367
+ @return
368
+ - \ref SU_ERROR_NONE on success
369
+ - \ref SU_ERROR_INVALID_INPUT if face is not a valid object
370
+ */
371
+ SU_RESULT SUFaceSetBackMaterial(SUFaceRef face, SUMaterialRef material);
372
+
373
+ /**
374
+ @brief Retrieves the flag indicating whether a face object has an affine
375
+ texture applied to its front.
376
+ @param[in] face The face object.
377
+ @param[out] is_affine The flag retrieved.
378
+ @related SUFaceRef
379
+ @return
380
+ - \ref SU_ERROR_NONE on success
381
+ - \ref SU_ERROR_INVALID_INPUT if face is not a valid object
382
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if is_affine is NULL
383
+ - \ref SU_ERROR_NO_DATA if face does not have a textured material applied to its
384
+ front
385
+ */
386
+ SU_RESULT SUFaceIsFrontMaterialAffine(SUFaceRef face, bool* is_affine);
387
+
388
+ /**
389
+ @brief Retrieves the flag indicating whether a face object has an affine
390
+ texture applied to its back.
391
+ @param[in] face The face object.
392
+ @param[out] is_affine The flag retrieved.
393
+ @related SUFaceRef
394
+ @return
395
+ - \ref SU_ERROR_NONE on success
396
+ - \ref SU_ERROR_INVALID_INPUT if face is not a valid object
397
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if is_affine is NULL
398
+ - \ref SU_ERROR_NO_DATA if face does not have a textured material applied to its
399
+ back
400
+ */
401
+ SU_RESULT SUFaceIsBackMaterialAffine(SUFaceRef face, bool* is_affine);
402
+
403
+ /**
404
+ @brief Computes the area of the face, taking into account all the inner loops
405
+ and cuts from openings.
406
+ @param[in] face The face object.
407
+ @param[out] area The area retrieved.
408
+ @related SUFaceRef
409
+ @return
410
+ - \ref SU_ERROR_NONE on success
411
+ - \ref SU_ERROR_INVALID_INPUT if face is not a valid object
412
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if area is NULL
413
+ */
414
+ SU_RESULT SUFaceGetArea(SUFaceRef face, double* area);
415
+
416
+ /**
417
+ @brief Computes the area of the face with the provided transformation applied.
418
+ //@since SketchUp 2016, API 4.0
419
+ @param[in] face The face object.
420
+ @param[in] transform A transformation to be appllied to the face.
421
+ @param[out] area The area retrieved.
422
+ @related SUFaceRef
423
+ @return
424
+ - \ref SU_ERROR_NONE on success
425
+ - \ref SU_ERROR_INVALID_INPUT if face is not a valid object
426
+ - \ref SU_ERROR_NULL_POINTER_INPUT if transformation is NULL
427
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if area is NULL
428
+ */
429
+ SU_RESULT SUFaceGetAreaWithTransform(
430
+ SUFaceRef face, const struct SUTransformation* transform, double* area);
431
+
432
+ /**
433
+ @brief Retrieves a flag indicating whether the face is complex, i.e. contains
434
+ either inner loops or openings cut by attached component instances or
435
+ attached groups.
436
+ @param[in] face The face object.
437
+ @param[out] is_complex The flag retrieved.
438
+ @related SUFaceRef
439
+ @return
440
+ - \ref SU_ERROR_NONE on success
441
+ - \ref SU_ERROR_INVALID_INPUT if face is not a valid face object
442
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if is_complex is NULL
443
+ */
444
+ SU_RESULT SUFaceIsComplex(SUFaceRef face, bool* is_complex);
445
+
446
+ /**
447
+ @brief Creates a UV helper for the face.
448
+ @param[in] face The face object.
449
+ @param[in] front Flag indicating whether to compute the UV coordinates for
450
+ the front of the face.
451
+ @param[in] back Flag indicating whether to compute the UV coordinates for
452
+ the back of the face.
453
+ @param[in] texture_writer An optional texture writer to aid in texture
454
+ coordinate calculations for non-affine textures.
455
+ @param[out] uv_helper The UV helper object created. Must be deallocated
456
+ via SUUVHelperRelease().
457
+ @related SUFaceRef
458
+ @return
459
+ - \ref SU_ERROR_NONE on success
460
+ - \ref SU_ERROR_INVALID_INPUT if face is not a valid object
461
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if uv_helper is NULL
462
+ */
463
+ SU_RESULT SUFaceGetUVHelper(
464
+ SUFaceRef face, bool front, bool back, SUTextureWriterRef texture_writer,
465
+ SUUVHelperRef* uv_helper);
466
+
467
+ /**
468
+ @brief Creates a UV helper for the face given a specific texture handle.
469
+ @param[in] face The face object.
470
+ @param[in] front Flag indicating whether to compute the UV coordinates for
471
+ the front of the face.
472
+ @param[in] back Flag indicating whether to compute the UV coordinates for
473
+ the back of the face.
474
+ @param[in] texture_writer An optional texture writer to aid in texture
475
+ coordinate calculations for non-affine textures.
476
+ @param[in] textureHandle The handle of the image that should be mapped to the
477
+ face.
478
+ @param[out] uv_helper The UV helper object created. Must be deallocated
479
+ via SUUVHelperRelease().
480
+ @related SUFaceRef
481
+ @return
482
+ - \ref SU_ERROR_NONE on success
483
+ - \ref SU_ERROR_INVALID_INPUT if face is not a valid object
484
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if uv_helper is NULL.
485
+ */
486
+ SU_RESULT SUFaceGetUVHelperWithTextureHandle(
487
+ SUFaceRef face, bool front, bool back, SUTextureWriterRef texture_writer, long textureHandle,
488
+ SUUVHelperRef* uv_helper);
489
+
490
+ /**
491
+ @brief Retrieves the number of attached drawing elements in a face.
492
+ @since SketchUp 2016, API 4.0
493
+ @param[in] face The face object.
494
+ @param[out] count The number of attached drawing elements.
495
+ @related SUFaceRef
496
+ @return
497
+ - \ref SU_ERROR_NONE on success
498
+ - \ref SU_ERROR_INVALID_INPUT if the face is not a valid object
499
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL
500
+ */
501
+ SU_RESULT SUFaceGetNumAttachedDrawingElements(SUFaceRef face, size_t* count);
502
+
503
+ /**
504
+ @brief Retrieves the attached drawing elements in the face.
505
+ @since SketchUp 2016, API 4.0
506
+ @param[in] face The face object.
507
+ @param[in] len The number of attached drawing elements to retrieve.
508
+ @param[out] elems The attached drawing elements retrieved.
509
+ @param[out] count The number of attached drawing elements retrieved.
510
+ @related SUFaceRef
511
+ @return
512
+ - \ref SU_ERROR_NONE on success
513
+ - \ref SU_ERROR_INVALID_INPUT if face is not a valid object
514
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if elems or count is NULL
515
+ */
516
+ SU_RESULT SUFaceGetAttachedDrawingElements(
517
+ SUFaceRef face, size_t len, SUDrawingElementRef elems[], size_t* count);
518
+
519
+ /**
520
+ @brief Reverses a face object.
521
+ @since SketchUp 2016, API 4.0
522
+ @param[in] face The face object.
523
+ @related SUFaceRef
524
+ @return
525
+ - \ref SU_ERROR_NONE on success
526
+ - \ref SU_ERROR_INVALID_INPUT if face is not a valid object
527
+ */
528
+ SU_RESULT SUFaceReverse(SUFaceRef face);
529
+
530
+ /**
531
+ @brief Retrieves the world and UV coordinates of a UV tile.
532
+
533
+ The UV tile bounds the given reference point on the plane of the face. If the
534
+ reference isn't on the plane of the face it will be projected onto it.
535
+
536
+ The world coordinates are on the plane of the face unless the texture is
537
+ projected. When the texture is projected the the world points are on an
538
+ arbitrary plane that is perpendicular to the projection direction.
539
+
540
+ The returned \p points and \p uv_coords can be used directly with
541
+ \ref SUMaterialPositionInput.
542
+
543
+ @since SketchUp 2021.1, API 9.1
544
+
545
+ @param[in] face
546
+ @param[in] reference A point of reference on the plane of the face.
547
+ @param[in] front Flag indicating whether to compute the UV Tile for the front
548
+ side of the face.
549
+ @param[out] points World coordinates for the bounding UV tile.
550
+ @param[out] uv_coords UV coordinates for the bounding UV tile.
551
+ @related SUFaceRef
552
+ @return
553
+ - \ref SU_ERROR_NONE on success
554
+ - \ref SU_ERROR_INVALID_INPUT if \p face is not a valid object.
555
+ - \ref SU_ERROR_NO_DATA if the \p face has no textured material of the given side.
556
+ - \ref SU_ERROR_NULL_POINTER_INPUT if \p reference is NULL.
557
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p points is NULL.
558
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p uv_coords is NULL.
559
+ */
560
+ SU_RESULT SUFaceGetUVTileAt(
561
+ SUFaceRef face, const struct SUPoint3D* reference, bool front, struct SUPoint3D points[4],
562
+ struct SUPoint2D uv_coords[4]);
563
+
564
+ /**
565
+ @brief Retrieves a flag indicating whether the face has a positioned texture.
566
+
567
+ A texture is positioned when it's not using the default texture coordinates.
568
+
569
+ When a user uses the Paint Bucket Tool to apply a material sampled from the
570
+ Material Browser it will use default texture coordinates and not be
571
+ positioned. It will be positioned if the user uses the Position Texture Tool.
572
+
573
+ @since SketchUp 2021.1, API 9.1
574
+
575
+ @param[in] face
576
+ @param[in] front Flag indicating whether to check the front or back side of the face.
577
+ @param[out] is_positioned
578
+ @related SUFaceRef
579
+ @return
580
+ - \ref SU_ERROR_NONE on success.
581
+ - \ref SU_ERROR_INVALID_INPUT if \p face is not a valid face object.
582
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p is_positioned is NULL.
583
+ */
584
+ SU_RESULT SUFaceIsTexturePositioned(SUFaceRef face, bool front, bool* is_positioned);
585
+
586
+ /**
587
+ @brief Clears the texture position.
588
+
589
+ This is similar to reseting the texture position from the SketchUp UI face context menu.
590
+
591
+ @since SketchUp 2022.0, API 10.0
592
+
593
+ @param[in] face
594
+ @param[in] front Flag indicating whether to clear the front or back side of the face.
595
+ @related SUFaceRef
596
+ @return
597
+ - \ref SU_ERROR_NONE on success.
598
+ - \ref SU_ERROR_INVALID_INPUT if \p face is not a valid face object.
599
+ */
600
+ SU_RESULT SUFaceClearTexturePosition(SUFaceRef face, bool front);
601
+
602
+ /**
603
+ @brief Retrieves a flag indicating whether the face has a projected texture.
604
+
605
+ A texture is projected when the user enables this property via the Position Texture Tool.
606
+
607
+ In SketchUp a projected texture can use an arbitrary plane, rather than the face's own plane. The
608
+ projection vector defines the normal of this plane and used this to project the texture onto the
609
+ face.
610
+
611
+ @since SketchUp 2021.1, API 9.1
612
+
613
+ @param[in] face
614
+ @param[in] front Flag indicating whether to check the front or back side of the face.
615
+ @param[out] is_projected
616
+ @related SUFaceRef
617
+ @return
618
+ - \ref SU_ERROR_NONE on success.
619
+ - \ref SU_ERROR_INVALID_INPUT if \p face is not a valid face object.
620
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p is_projected is NULL.
621
+ */
622
+ SU_RESULT SUFaceIsTextureProjected(SUFaceRef face, bool front, bool* is_projected);
623
+
624
+ /**
625
+ @brief Retrieves a vector representing the projection direction for the texture on
626
+ the given side of the face.
627
+
628
+ @since SketchUp 2021.1, API 9.1
629
+
630
+ @param[in] face
631
+ @param[in] front Flag indicating whether to use the front or back side of the face.
632
+ @param[out] vector
633
+ @related SUFaceRef
634
+ @return
635
+ - \ref SU_ERROR_NONE on success.
636
+ - \ref SU_ERROR_INVALID_INPUT if \p face is not a valid face object.
637
+ - \ref SU_ERROR_NO_DATA if \p face does not have a projected material applied.
638
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p vector is NULL.
639
+ */
640
+ SU_RESULT SUFaceGetTextureProjection(SUFaceRef face, bool front, struct SUVector3D* vector);
641
+
642
+ /**
643
+ @brief Clears the texture projection.
644
+
645
+ This is similar to toggling off Projection from the Position Texture tool in the UI.
646
+
647
+ @since SketchUp 2021.1, API 9.1
648
+
649
+ @param[in] face
650
+ @param[in] front Flag indicating whether to clear the front or back side of the face.
651
+ @related SUFaceRef
652
+ @return
653
+ - \ref SU_ERROR_NONE on success.
654
+ - \ref SU_ERROR_INVALID_INPUT if \p face is not a valid face object.
655
+ */
656
+ SU_RESULT SUFaceClearTextureProjection(SUFaceRef face, bool front);
657
+
658
+ /**
659
+ @brief Positions a textured material on the face.
660
+
661
+ The texture is positioned using 1 to 4 pairs of model and uv points. The points are used in pairs to
662
+ describe where a point in the texture image is positioned on the face. This is similar to how
663
+ textures are positioned in the UI using the Position Texture tool.
664
+
665
+ @since SketchUp 2021.1, API 9.1
666
+
667
+ @param[in] face
668
+ @param[in] front Flag indicating whether to use the front or back side of the face.
669
+ @param[in] mapping
670
+ @related SUFaceRef
671
+ @return
672
+ - \ref SU_ERROR_NONE on success
673
+ - \ref SU_ERROR_INVALID_INPUT if \p face is not a valid face object
674
+ - \ref SU_ERROR_NULL_POINTER_INPUT if \p mapping is NULL
675
+ - \ref SU_ERROR_INVALID_ARGUMENT if \p mapping doesn't have a valid textured material
676
+ - \ref SU_ERROR_INVALID_ARGUMENT if \p mapping doesn't have 1-4 points/uv_coords.
677
+ - \ref SU_ERROR_INVALID_ARGUMENT if valid texture coordinates could not be computed from \p mapping.
678
+ */
679
+ SU_RESULT SUFacePositionMaterial(
680
+ SUFaceRef face, bool front, struct SUMaterialPositionInput* mapping);
681
+
682
+ #ifdef __cplusplus
683
+ } // extern "C" {
684
+ #endif
685
+
686
+ #endif // SKETCHUP_MODEL_FACE_H_