Entities
Entities are the basic elements which are used to draw geometry in CAD Sketcher. They differ from regular blender mesh or curve elements which means native blender tools aren't able to interact with it as long as they aren't converted. See the chapter integration for further details on how to process extension specific geometry.
Entities are defined by a set of parameters and pointers to other entities which are editable at any point in time. This allows non-destructive workflows and also ensures that geometry is resolution independent. A curve will always follow a given radius no matter how it's transformed. Entities can be created with the various Workspacetools.
Active
An entity is considered to be active when the sketch it belongs to is set as the active sketch or, for 3D entities, when no sketch is active.
Visibility
Entities can be hidden. Access the setting from the entity's context menu or from the entity browser.
Construction
Entities have a construction parameter which can be set via the entity's context menu. If it's set to true the entity will be ignored when converting the geometry however it's still used to solve the geometric system. It's generally good practice to mark entities as construction if they're not part of the final geometry.
Fixed
Entities can be fixed via the entity's context menu. A fixed entity won't have any degrees of freedom and therefor cannot be adjusted by the solver. It's good practice to base geometry on a fixed origin point.
Warning: While this currently applies to all entities it's intended to be used with points only.
Types
There are different types of entities, some of them apply in 2 dimensional space which requires a sketch as a parameter.
Entity types follow the implementation of solvespace.
Only 2D entities can be converted later, check the chapter integration for details.
Bases: Point3D
, PropertyGroup
Representation of a point in 3D Space.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
location |
FloatVectorProperty
|
Point's location in the form (x, y, z) |
required |
Source code in model/point_3d.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
Bases: SlvsGenericEntity
, PropertyGroup
Representation of a line in 3D Space.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
p1 |
SlvsPoint3D
|
Line's startpoint |
required |
p2 |
SlvsPoint3D
|
Line's endpoint |
required |
Source code in model/line_3d.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
closest_picking_point(origin, view_vector)
Returns the point on this entity which is closest to the picking ray
Source code in model/line_3d.py
59 60 61 62 63 |
|
Bases: Normal3D
, PropertyGroup
Representation of a normal in 3D Space which is used to store a direction.
This entity isn't currently exposed to the user and gets created implicitly when needed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
orientation |
Quaternion
|
A quaternion which describes the rotation |
required |
Source code in model/normal_3d.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
|
Bases: SlvsGenericEntity
, PropertyGroup
Representation of a plane which is defined by an origin point and a normal. Workplanes are used to define the position of 2D entities which only store the coordinates on the plane.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
p1 |
SlvsPoint3D
|
Origin Point of the Plane |
required |
nm |
SlvsNormal3D
|
Normal which defines the orientation |
required |
Source code in model/workplane.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
Bases: SlvsGenericEntity
, PropertyGroup
A sketch groups 2 dimensional entities together and is used to later convert geometry to native blender types.
Entities that belong to a sketch can only be edited as long as the sketch is active.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wp |
SlvsWorkplane
|
The base workplane of the sketch |
required |
Source code in model/sketch.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
|
Bases: Point2D
, PropertyGroup
Representation of a point in 2D space.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
co |
FloatVectorProperty
|
The coordinates of the point on the worpkplane in the form (U, V) |
required |
sketch |
SlvsSketch
|
The sketch this entity belongs to |
required |
Source code in model/point_2d.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
|
Bases: Entity2D
, PropertyGroup
Representation of a line in 2D space. Connects p1 and p2 and lies on the sketche's workplane.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
p1 |
SlvsPoint2D
|
Line's startpoint |
required |
p2 |
SlvsPoint2D
|
Line's endpoint |
required |
sketch |
SlvsSketch
|
The sketch this entity belongs to |
required |
Source code in model/line_2d.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
|
closest_picking_point(origin, view_vector)
Returns the point on this entity which is closest to the picking ray
Source code in model/line_2d.py
65 66 67 68 69 70 |
|
connection_angle(other, **kwargs)
Returns the angle at the connection point between the two entities or None if they're not connected or not in 2d space.
kwargs
key values are propagated to other get_connection_point
functions
Source code in model/line_2d.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
|
direction(point, is_endpoint=False)
Returns the direction of the line, true if inverted
Source code in model/line_2d.py
89 90 91 92 93 94 |
|
normal(position=None)
Returns vector perpendicular to line, position is ignored
Source code in model/line_2d.py
154 155 156 157 158 159 |
|
orientation()
Return the orientation of the line in 3d space
Source code in model/line_2d.py
147 148 149 |
|
project_point(coords)
Projects a point onto the line
Source code in model/line_2d.py
72 73 74 75 76 77 78 |
|
Bases: Entity2D
, PropertyGroup
Representation of an arc in 2D space around the centerpoint ct. Connects p2 to p3 or (vice-versa if the option invert_direction is true) with a circle segment that is resolution independent. The arc lies on the sketche's workplane.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
p1 |
SlvsPoint2D
|
Arc's centerpoint |
required |
p2 |
SlvsPoint2D
|
Arc's startpoint |
required |
p2 |
SlvsPoint2D
|
Arc's endpoint |
required |
nm |
SlvsNormal3D
|
Orientation |
required |
sketch |
SlvsSketch
|
The sketch this entity belongs to |
required |
Source code in model/arc.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 |
|
angle
property
Returns an angle in radians from zero to 2*PI
connection_angle(other, connection_point=None, **kwargs)
Returns the angle at the connection point between the two entities or None if they're either not connected or not in 2d space
You may use connection_point
in order to remove ambiguity in case
multiple intersections point exist with other entity.
kwargs
key values are propagated to other get_connection_point
functions
Source code in model/arc.py
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
|
direction(point, is_endpoint=False)
Returns the direction of the arc, true if inverted
Source code in model/arc.py
152 153 154 155 156 |
|
normal(position=None)
Return the normal vector at a given position
Source code in model/arc.py
135 136 137 138 139 |
|
project_point(coords)
Projects a point onto the arc
Source code in model/arc.py
173 174 175 176 177 |
|
Bases: Entity2D
, PropertyGroup
Representation of a circle in 2D space. The circle is centered at ct with its size defined by the radius and is resoulution independent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ct |
SlvsPoint2D
|
Circle's centerpoint |
required |
radius |
FloatProperty
|
The radius of the circle |
required |
nm |
SlvsNormal2D
|
|
required |
sketch |
SlvsSketch
|
The sketch this entity belongs to |
required |
Source code in model/circle.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 |
|