-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rectangle Surface Primitive and Integration with Box #156
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 👍
Some comments:
- I find the surface primitives
Square
fromRegularPrism
andRectangle
fromBox
quite similar. People might think that a squareRectangle
might be aSquare
, so we should discuss whether we want to renameSquare
then. - For the
Rectangle
constructors: what do you think about introducing aliases
(e.g.RectangleX = Rectangle{<:Any, Val(:x)}
)?
Because I do not think it is the user-friendliest option to useVal(:x)
as input forRectangle
.
Also, it would allow getting rid of most of theVal(:x)
in the code.
return AbstractSurfacePrimitive[Rectangle(b, Val(:x), xMin)] | ||
elseif isapprox(yMin, yMax, atol = tol) | ||
return AbstractSurfacePrimitive[Rectangle(b, Val(:y), yMin)] | ||
elseif isapprox(zMin, zMax, atol = tol) | ||
return AbstractSurfacePrimitive[Rectangle(b, Val(:z), zMin)] | ||
else | ||
return AbstractSurfacePrimitive[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove AbstractSurfacePrimitive
before the [
?
Julia will know that this is a Vector{Rectangle}
and convert it to a Vector{AbstractSurfacePrimitive}
, e.g. when determining the decomposed surfaces of contacts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've had this conversation before. This also happens with the Sphere and in some other specific cases. The AbstractSurfacePrimitive
is there for consistency. This is still a pending issue that deserves its own PR
src/ConstructiveSolidGeometry/plotting/SurfacePrimitives/ConeMantle.jl
Outdated
Show resolved
Hide resolved
src/ConstructiveSolidGeometry/plotting/SurfacePrimitives/ConeMantle.jl
Outdated
Show resolved
Hide resolved
src/ConstructiveSolidGeometry/plotting/SurfacePrimitives/Rectangle.jl
Outdated
Show resolved
Hide resolved
Sampling with Sampling only at
|
Definition and plotting for Rectangle Surface Primitive. Rectangles are restricted to have normal vectors on
x
,y
, orz
in()
,sample()
distance_to_surface()
. To be added along with that of prism surfaces.sample()
with ticksBox now has
get_decomposed_surfaces()
. It gets decomposed into two of each:Rectangle{T, Val{:x}}
,Rectangle{T, Val{:y}}
,Rectangle{T, Val{:z}}
unless one of the dimensions is zero.